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
Add a space where two tags met #49
Comments
I think to do this properly you'll need a list of block tags (or a list of inline tags). You want to add a space wherever a block tag ends (actually it should probably be a newline character and let the browser convert it to space), but not where an inline tag ends (e.g. |
I agree, and there should be an option to override that list. I'd take a pull request for this one. On Fri, Nov 27, 2015 at 12:42 PM, Daniel Grad notifications@github.com
*THOMAS BOUTELL, *DEV & OPS |
Until this gets implemented, a messy hack would be: text = text.replace(/>/g, '> ');
text = sanitizeHtml(text, {allowedTags:[]}); |
up!! Is this still on? |
@r-custodio As mentioned, I'd take a PR for this. Unfortunately as maintainer I can't necessarily implement every feature. |
@abea this is labeled as |
@greghub Sure. It had been sitting idle for years, so there didn't seem much reason to keep it open. I'll reopen it if you want to work on it for 2.x and let the stalebot close it if nothing happens. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
it's 2023 now. thank you for your solution =) |
@rusakovic Contributions are welcome! |
it's 2024 now. :) |
Yes, it's 2024 now, and as always, community contributions are welcome. 😄 This isn't a feature that matters for our use cases, although I appreciate it would be nice for developers reading the resulting markup. |
Reopening for potential community PRs. |
I'm wondering if there is a way to create a space wherever tags were.
Picture this:
<div>Some sentence.</div><div>Some other Sentence</div>
It converts to
Some sentence.Some other Sentence
when I runtext = sanitizeHtml(text, {allowedTags:[], allowedAttribute: {}});
Is there an option to add whitespace so the output is better:
Some sentence. Some other Sentence
The text was updated successfully, but these errors were encountered: