Skip to content
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

Sanitize-text troubles with only whitespace on line #2202

Open
ascholerChemeketa opened this issue Jul 9, 2024 · 0 comments
Open

Sanitize-text troubles with only whitespace on line #2202

ascholerChemeketa opened this issue Jul 9, 2024 · 0 comments

Comments

@ascholerChemeketa
Copy link
Contributor

If a block of text that is being sanitized has a line with only spaces, it can throw off the indentation stripping.

        this has 8 spaces of indentation
   
        this has 8 spaces - the preceding line has 4 spaces

The sanitize-text template will decide that block needs to have 4 spaces cleared. If the blank line has no spaces, it will get 8 spaces cleared.

In general, it would be better to strip out those blank spaces and not consider that line while calculating the left indent. But in some languages that might cause problems (markdown???).

Suggested fix is to make sanitize-text rip out spaces on otherwise blank lines. But, add a parameter to it that allows for preserving those spaces. Elements like <program> and <pre> would need an optional attribute to set that parameter.

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

No branches or pull requests

1 participant