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

Incorrectly decoding encoded HTML tags #106

Open
apjones6 opened this issue Aug 29, 2015 · 2 comments · May be fixed by #438
Open

Incorrectly decoding encoded HTML tags #106

apjones6 opened this issue Aug 29, 2015 · 2 comments · May be fixed by #438

Comments

@apjones6
Copy link

With a standard MD parser encoded HTML tags allows you to include them as readable text. For example (plain HTML included for comparison):

<iframe src="http://www.w3schools.com"></iframe>
<iframe src="http://www.w3schools.com"></iframe>

results in the output HTML:

<p>&lt;iframe src="http://www.w3schools.com"&gt;&lt;/iframe&gt;</p>
<iframe src="http://www.w3schools.com"></iframe>

However if I put this output HTML through to-markdown the encoded < and > characters are erroneously decoded. This results in the following markdown:

<iframe src="http://www.w3schools.com"></iframe>
<iframe src="http://www.w3schools.com"></iframe>

(whitespace lines removed from examples for brevity)

apjones6 pushed a commit to apjones6/to-markdown that referenced this issue Sep 15, 2015
@oliverguenther
Copy link

This is an actual issue for using turndown as a Markdown converter whenever using escaped HTML elements in the input format, as they will be incorrectly output as HTML tags. A quick hack to fix this is ensuring < and > are always re-encoded as entities.

@bjones1
Copy link

bjones1 commented Jun 2, 2023

Duplicate issue: #261.

bjones1 added a commit to bjones1/turndown that referenced this issue Jun 2, 2023
bjones1 added a commit to bjones1/turndown that referenced this issue Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants