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

Regression for **bolded_code_friendly** text #589

Closed
mhils opened this issue Jul 18, 2024 · 1 comment · Fixed by #590
Closed

Regression for **bolded_code_friendly** text #589

mhils opened this issue Jul 18, 2024 · 1 comment · Fixed by #590

Comments

@mhils
Copy link
Contributor

mhils commented Jul 18, 2024

Describe the bug
Starting with fcaadfe, markdown2 renders _ as <em> in bolded text, even if code-friendly is set. @Crozzers, any idea on what's the best way to fix this?

To Reproduce

**bold_but_not_emphasized**

Full test case: mhils@bf39e38

Expected behavior

_ should stay as-is.

Additional context

Thank you so much for the other changes in 2.5.0, it's fantastic! 🍰

@Crozzers
Copy link
Contributor

When I added the CodeFriendly extra class I had to change the program flow a bit, since it was no longer directly part of the _do_italics_and_bold function.

Previously we had two different versions of the strong/em regexes and we'd run one or the other. That's not possible in the new Extras format so the CodeFriendly extra runs before italics and bold and hashes text to protect it from the regex.

Currently it only hashes text if it's using the _underscore bold syntax_, but for *star syntax* it doesn't check if the text contains any underscores, which is how this can slip through.

I'll modify the extra to check for this and hash the text to protect it

nicholasserra added a commit that referenced this issue Jul 24, 2024
Fix underscores within bold text getting emphasized (#589)
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