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

middle-word-em=False does not emit expected strong #606

Closed
enigma opened this issue Oct 24, 2024 · 1 comment · Fixed by #607
Closed

middle-word-em=False does not emit expected strong #606

enigma opened this issue Oct 24, 2024 · 1 comment · Fixed by #607

Comments

@enigma
Copy link

enigma commented Oct 24, 2024

Describe the bug

I'd like to use middle-word-em to remove random italics where code-friendly is not enough. One such case is **worst_case_scenario** which should emit <p><strong>worst_case_scenario</strong></p> but instead emits <p>**worst_case_scenario**</p>.

NB: it does not emit strong even if there's no _ in the input.

To Reproduce

from markdown2 import Markdown

def test_middle_word_em():
    md = Markdown(extras={"middle-word-em": False})
    assert md.convert("**worst_case_scenario**") == "<p><strong>worst_case_scenario</strong></p>"

You can verify the failure with pytest -vvv:

    def test_middle_word_em():
        md = Markdown(extras={"middle-word-em": False})
>       assert md.convert("**worst_case_scenario**") == "<p><strong>worst_case_scenario</strong></p>"
E       AssertionError: assert '<p>**worst_case_scenario**</p>\n' == '<p><strong>worst_case_scenario</strong></p>'
E         
E         - <p><strong>worst_case_scenario</strong></p>
E         + <p>**worst_case_scenario**</p>

Expected behavior
A clear and concise description of what you expected to happen.
**worst_case_scenario** should emit <p><strong>worst_case_scenario</strong></p>

Debug info
markdown2==2.5.0

Any extras being used:
middle-word-em: False

Additional context

it does not emit strong even if there's no _ in the input.

nicholasserra added a commit that referenced this issue Oct 28, 2024
Fix `middle-word-em` extra preventing strongs from being recognized (#606)
@nicholasserra
Copy link
Collaborator

Thanks for the report! Fixed in #607

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