Skip to content

Normalize and fix rendering of authored whitespace in programs for HTML #2548

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

ascholerChemeketa
Copy link
Contributor

The HTML static and dynamic (activecode vs now) handle authored whitespace slightly differently and eat whitespace in some places it might be desirable to add it. This fixes overzealous whitespace pruning and normalizes the behavior between the two outputs.

Clean diffs on SB. None of the issues existed in it or are not apparent in diffs (different handling between static and activecode programs).

Notes:
TESTING ONLY commit illustrates problem using hello-world. Assuming you will drop that commit after using it for before/after. I could move some/all of those into a random place in SA if you want.

2nd commit has the string-utils testbed I mused about before and some tests for existing (but not all) utils.

3rd commit adds a substring-after-preserve util and tests for it.

4th is the actual fix for authored whitespace in programs

5th drops an unused string util. It does the same job as trim-end with $preserve-intentional = true()

@ascholerChemeketa ascholerChemeketa marked this pull request as draft June 4, 2025 20:44
@ascholerChemeketa
Copy link
Contributor Author

Working on related issue raised by Haris on -dev. Draft for now...

@ascholerChemeketa ascholerChemeketa marked this pull request as ready for review June 4, 2025 21:23
@ascholerChemeketa
Copy link
Contributor Author

Looks like it resolves what he asked. Back to ready status.

rbeezer added a commit that referenced this pull request Jul 22, 2025
@rbeezer
Copy link
Collaborator

rbeezer commented Jul 22, 2025

Merged as-is (sans demo commit). Thanks for the maintenance work, and I like the new tests! Thanks for the demo commit.

A couple of follow-on suggestions:

  • Can you craft an example like the demo commit that would stress any changes to the newer bits of code (for the sample article)? (Yes, I know that is what the tests are for!)
  • How about a simple/short README.md in tests/ just saying what each file is for (including the xsltproc pretext-text-utilities-test.xsl null.xml instruction)?
  • I don't think --xinclude is needed to execute the tests? And for me, I think I only need one dash these days anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants