-
-
Notifications
You must be signed in to change notification settings - Fork 114
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
Question about comments #170
Comments
Unfortunately not, it's something I've been wanting to add for a while. This feature would require updating the read-tag-content function to be smarter to consume the new line if it follows the tag. This should happen only in a case where the line consists of just the tag itself. |
I guess the requirement would be as follows. If a tag is on a blank line, and it does not produce output, then it should be removed. So, you'd have to check that the only content before the tag and after the last new line character consists of spaces, and the type of tag that was created. A better place to handle that might be here. |
FWIW, Shopify’s template system, Liquid (with which I’m familiar because it’s built in to Jekyll), has a more explicit but less elegant mechanism:
I’d love to see some solution to this ship with the library. For now, FWIW, I’m running my output through this naive, brittle, hacky function: (defn reduce-whitespace
[s]
(str/replace s #"\n\s+\n" "\n")) |
Using a hyphen to indicate that the whitespace around the tag should be stripped out actually doesn't sound terrible. I wouldn't have time to look at this in the near future, but I would be open to a PR. |
I have a template like:
The line with the comment
{# STAT- In-Process #}
gets rendered as a newline. Can I prevent this while still keeping it at its own line?The text was updated successfully, but these errors were encountered: