-
Notifications
You must be signed in to change notification settings - Fork 3.5k
fix: Fix backtick and code rendering in links #3783
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
Conversation
|
@basilaiman is attempting to deploy a commit to the MarkedJS Team on Vercel. A member of the Team first needs to authorize it. |
Summary of ChangesHello @basilaiman, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical parsing bug in Markdown rendering where code spans containing backticks within link text were not correctly processed, resulting in invalid HTML. By refining the regular expression responsible for identifying inline labels, the change ensures that these complex Markdown structures are accurately interpreted and rendered, significantly improving the robustness and correctness of the Markdown parser. The inclusion of new test cases, particularly for ReDoS vulnerabilities, further strengthens the stability of the parsing logic. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request aims to fix an issue with rendering code spans that contain backticks within link labels. While the intention is correct and new tests have been added to cover this scenario, the regular expression change in src/rules.ts appears to be flawed. It does not correctly handle code spans with backticks inside them, which contradicts the goal of this PR. I've left a specific comment detailing the issue with the regex.
UziTech
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! 💯
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
# [16.4.0](v16.3.0...v16.4.0) (2025-10-07) ### Bug Fixes * Fix backtick and code rendering in links ([#3783](#3783)) ([302ee59](302ee59)) * fix links with square brackets in inline code break wrapping italics ([#3785](#3785)) ([e3c0d3e](e3c0d3e)) * Make `www` case-sensitive when detecting link starts ([#3770](#3770)) ([626d961](626d961)) ### Features * Add async provideParser provideLexer ([#3756](#3756)) ([09577e5](09577e5))
Marked version: 16.3.0
Markdown flavor: CommonMark
Description
Fixes rendering of code spans with backticks inside link text.
When a link contains a code span with backticks inside. The code span was being tokenized separately from the link, resulting in malformed HTML output.
Example
Expectation
Result
What was attempted
Updated the _inlineLabel pattern to match the proper code span syntax that handles multiple backticks as delimiters:
Contributor
Committer
In most cases, this should be a different person than the contributor.