-
Notifications
You must be signed in to change notification settings - Fork 395
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
Errors when HTML has a comment tag #32
Comments
Ahh - it should strip HTML commends before attempting to parse inner HTML but perhaps it's failing if there's nothing in the comment - this is an issue with HTMLString. I'll resolve ASAP, thanks for highlighting. |
Even if there's content in it, it's still failing :) |
Hmmm... that's odd - I don't think there's a test spec for this so will add one at the same time. |
OK that now correctly removes comments before parsing (my RegExp was incorrect). There's now comments in the test spec data. Only down side is any comments you add will be removed as soon as the element containing them is edited and saved, I hadn't considered supporting comments within the editable regions up to this point and I'm not entirely sure how they would be catered for when a user edits the content - but happy to consider arguments for supporting them :) |
The reason I'm actually using comments is that I needed to add some sort of hidden marker inside the html. So for if I generate |
Can you place those markers outside of the editable regions? For example:
I actually do something very similar with Jinja2 templates for the |
If they need to be inside of the editable element one option would be to consider using a span tag:
It should still be relatively easy to extract this content safely. |
Right now as an alternative I'm wrapping the content inside a div with a |
Ah OK that makes a lot of sense - if you use a |
So will comments not be stripped out anymore? :) |
So if you use comments in static elements they shouldn't be stripped - they certainly aren't in Chrome - however as I say it does depend on the |
I'm getting this:
at line 1055:
I just added this into the HTML:
<!-- -->
The text was updated successfully, but these errors were encountered: