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

Escape right square bracket #148

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

eri24816
Copy link

@eri24816 eri24816 commented Sep 14, 2024

Add the right square bracket (]) to the list of escaped symbols. This is necessary to correctly represent a link text containing a right square bracket:

html = '<a href="citation.html">[How to cite this work]</a>'
print(markdownify(html))

# before this pr: r'[\[How to cite this work]](citation.html)'
# after this pr:  r'[\[How to cite this work\]](citation.html)'

@jsm28
Copy link
Contributor

jsm28 commented Oct 2, 2024

Could you also add a test for this case to the testsuite? (Note, you need a fix to test function naming from #149 or #122 for the miscellaneous escaping tests to actually be run.)

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 this pull request may close these issues.

2 participants