-
Notifications
You must be signed in to change notification settings - Fork 144
Add option to as_html for disabling HTML character escaping #401
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 option to as_html for disabling HTML character escaping #401
Conversation
This allows for the included HTML renderer to match how GFM works with inline HTML. Useful for rendering line-breaks in tables, among other things
ty for your PR @paradox460 are you expecting a release or are you using your fork? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am completely emberassed to ask you this, but I just cannot find the line where escape: false
makes the difference, which, obviously it does, thanx to your test.
Seems I am blind after a tough week, so please bear with me...
No rush for a release, if we need to we can point our mix at the branch until an update is released. The affected lines are 179-188 of transform.ex. The actual sanitization functions (in the for loop) will only run if There's no explicit lines where |
Fix a case where pasisng an option such as smartypants: false would cause for escaping to be disabled as well, due to a bad pattern match
Just thought up an edge case I missed, and fixed it. Now it behaves entirely as it should |
Ty for your explanation, BTW I still do not see it, I'll just go through the code after merging 😊, you shalt not be bothered anymore 😉 |
No problem, it took me about half an hour of probing to understand how the fall through worked. Pattern matching is a pathway to many abilities some consider unnatural 🤣 |
Well spoken my friend, however as I needed some time to grasp it I wanted to take advantage of having myself familiarised with the code again and just released 1.4.14, (on 2021-02-21 what a nice symmetry) containing your nice addendum. Thank you and keep safe. If I were stupid and mean I'd say, it's Dave's fault ;) Well but I am not mean 😏 |
Looking over the recent additions, the post-processor looks like it will be extremely useful. One thing that I've noticed is that many other parsers are highly extensible, i.e. Sundown, Redcarpet, etc. If you need help/input building an extensible interface for the AST parsing and such, I'd be happy to contribute what time I can. I can see that there are some requests for it, and it would be nice to add support for features from projects such as pandoc, kramdown, etc. |
Thank you for your interest, what you are talking about would probably go into EarmarkParser but we can talk about here as well: My priorities for EarmarkParser are quite set out:
Unfortunately your ideas go into 4. That said I would welcome help by all means, I have not much time and energy left right now. This also explains my conservative approach Looking forward hearing from you |
Adds an
escape
option, used by the HTML transform, to allow passing through of HTML tags without escaping.Mostly useful when using table syntax, as there's no way to do newlines in a table cell without using
<br/>