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

underscores in <kbd> and <samp> are incorrectly escaped, whereas underscores in <code> are correctly not escaped #102

Closed
chrispy-snps opened this issue Jan 10, 2024 · 0 comments · Fixed by #104

Comments

@chrispy-snps
Copy link
Collaborator

chrispy-snps commented Jan 10, 2024

<code>, <kbd>, and <samp> elements are all converted to Markdown code spans with single backticks.

However, underscores in <kbd> and <samp> are incorrectly escaped (they become literal backslashes in the Markdown code span), whereas underscores in <code> are correctly not escaped:

from markdownify import markdownify as md
md('<code>A_B_C</code>')    # > '`A_B_C`'
md('<kbd>A_B_C</kbd>')      # > '`A\\_B\\_C`'
md('<samp>A_B_C</samp>')    # > '`A\\_B\\_C`'
@chrispy-snps chrispy-snps changed the title underscores in <kbd> are incorrectly escaped, whereas underscores in <code> are correctly not escaped underscores in <kbd> are incorrectly escaped, whereas underscores in <code> and <samp> are correctly not escaped Jan 13, 2024
@chrispy-snps chrispy-snps changed the title underscores in <kbd> are incorrectly escaped, whereas underscores in <code> and <samp> are correctly not escaped underscores in <kbd> and <samp> are incorrectly escaped, whereas underscores in <code> are correctly not escaped Jan 15, 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
Development

Successfully merging a pull request may close this issue.

1 participant