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

Markdown Image link that has title text with escaped quotation is not recognized #305

Open
krisyang1125 opened this issue Oct 9, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@krisyang1125
Copy link

Describe the bug

When I have a markdown image like this where the title contains the same escaped quotation mark as the one it's nested in, the parser will fail to parse the node as an markdown image
![panda dancing with cat](https://i.imgur.com/img.jpg 'title\'')

I expected the markdown image link to be recognize as image node type

I use this parser to extract image links from markdown text and host them on my server for security reasons. This false negative is not ideal for my use case.

Let me know if you need any other info. Thanks

Reproduce the bug

text = """![panda dancing with cat](https://i.imgur.com/img.jpg 'title\'')"""
md = MarkdownIt("gfm-like")
syntax_tree = SyntaxTreeNode(md.parse(text))

# Traverse the tree and check if a tree node of image type exists

List your environment

Version of markdown-it-py: 3.0.0
Versions of mdit-py-plugins: 0.3.5
The version of Python you're using: 3.9
Your operating system: Ubuntu 18.04.6

@krisyang1125 krisyang1125 added the bug Something isn't working label Oct 9, 2023
@welcome
Copy link

welcome bot commented Oct 9, 2023

Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.

If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).

Welcome to the EBP community! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant