fix: fix strikethrough flanking rules#3882
Conversation
|
@UziTech is attempting to deploy a commit to the MarkedJS Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Summary of ChangesHello @UziTech, 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 an issue where strikethrough parsing was overly permissive, leading to unintended rendering in specific text patterns. It overhauls the strikethrough tokenization process to strictly adhere to GitHub Flavored Markdown's flanking rules, ensuring that tilde characters are only interpreted as strikethrough delimiters when properly positioned and surrounded by appropriate characters. This change improves the accuracy and consistency of Markdown rendering, particularly for content that might contain tildes in non-strikethrough contexts. 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.
Code Review
This pull request implements GFM-style flanking rules for tilde-based strikethrough, mirroring the existing logic for asterisks in emphasis and strong tags. A security audit found no high or critical severity vulnerabilities, covering ReDoS, data flow, Unicode handling, and flanking rule logic. The overall approach is sound, but there are minor improvements needed in the new del tokenizer method in src/Tokenizer.ts, specifically regarding some dead code, a misleading comment, and a line that can be simplified for readability. After these minor changes, the PR should be in great shape.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request correctly implements the GFM flanking rules for strikethrough by adapting the existing logic from emphasis/strong. This is a great step towards better GFM compliance. However, this has been achieved by duplicating a significant amount of complex code and regular expressions. My review focuses on suggesting refactoring opportunities to remove this duplication, which will improve the long-term maintainability and robustness of the codebase.
Marked version: 17.0.1
Markdown flavor: GitHub Flavored Markdown
Description
Copy asterisk (
*) emStrong flanking rules for tilde (~) strikethroughContributor
Committer
In most cases, this should be a different person than the contributor.