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

Angle brackets <> aren't escaped. #99

Closed
AnyOldName3 opened this issue Dec 7, 2023 · 1 comment · Fixed by #118
Closed

Angle brackets <> aren't escaped. #99

AnyOldName3 opened this issue Dec 7, 2023 · 1 comment · Fixed by #118

Comments

@AnyOldName3
Copy link

>>> markdownify('text&lt;text&gt;')                              
'text<text>'

In at least some flavours of Markdown, this would need to be text\<text\> instead. As an example, GitHub-flavoured Markdown gives

text

and

text<text>

without and with backslashes respectively.

@chrispy-snps
Copy link
Collaborator

@AnyOldName3 - I am not familiar with the various Markdown variants available. Are you aware of any Markdown variants where angle brackets aren't escaped? The only rule I am aware of is to escape them everywhere except in preformatted text spans and blocks.

jsm28 added a commit to jsm28/python-markdownify that referenced this issue Apr 3, 2024
There are many punctuation characters that sometimes have significance
in Markdown; more systematically escape them all (based on a new
escape_misc configuration option).

A limited attempt is made to limit the escaping of '.' and ')' to the
context where they might have Markdown significance (after a number,
where they can indicate an ordered list item); no such attempt is made
for the other characters (and even that limiting of '.' and ')' may
not be entirely safe in all cases, as it's possible the HTML could
have the number outside the block being escaped in one go,
e.g. `<span>1</span>.`.

Fixes matthewwithanm#99
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants