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

Retain escaping of html except within code or pre tags. #57

Merged
merged 1 commit into from
Apr 11, 2015

Conversation

smblackburn
Copy link
Contributor

Escaped HTML entities do not remain escaped on output.

For example:
<p>&lt;div&gt;</p> yields <div> in the output markdown, when it should yield &lt;div&gt;. The exception is within pre or code tags, which do not need the escaping.

This code was taken from a pull request by @brondsem on the @aaronsw repo that was never merged or closed: aaronsw/html2text#59

@coveralls
Copy link

Coverage Status

Coverage increased (+0.26%) to 75.95% when pulling 446a8eb on smblackburn:master into 555f4a9 on Alir3z4:master.

@Alir3z4 Alir3z4 self-assigned this Apr 11, 2015
@Alir3z4
Copy link
Owner

Alir3z4 commented Apr 11, 2015

@smblackburn Nice fix.
Thanks for the patch, I'll merge right away.

Alir3z4 added a commit that referenced this pull request Apr 11, 2015
Retain escaping of html except within code or pre tags.

Thanks Scott Blackburn @smblackburn
@Alir3z4 Alir3z4 merged commit 759c563 into Alir3z4:master Apr 11, 2015
@Alir3z4
Copy link
Owner

Alir3z4 commented Jan 14, 2016

@smblackburn Could you have a look at #109 ?

@tahajahangir
Copy link

I think <div> is the correct output for <p>&lt;div&gt;</p> (as <Hi> is the correct output for <p>&lt;Hi&gt;</p>, and &lt;Hi&gt; is wrong!)

snarfed added a commit to snarfed/granary that referenced this pull request Dec 26, 2019
…o `s

... so that GitHub renders HTML entities like &gt; inside them instead of leaving them escaped. background: https://chat.indieweb.org/dev/2019-12-24#t1577174464779200

the html2text people have gone back and forth on how to handle this: Alir3z4/html2text#57, Alir3z4/html2text#109, etc. original bridgy publish github escaping was added in snarfed/bridgy#810.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants