-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
fix code blocks #2622
fix code blocks #2622
Conversation
XSS bug and now this? Shame on you hahaha 😄 Anyway, thank you for the fix, I'll review it soon. |
@@ -12,7 +12,7 @@ module.exports = function (md, renderers, defaultRenderer) { | |||
} | |||
|
|||
const marker = state.src.charCodeAt(pos) | |||
if (!(marker === 96 || marker === 126)) { | |||
if (marker !== 0x7E/* ~ */ && marker !== 0x60 /* ` */) { |
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.
Do you mind to add a coment explaining what the chars are you're using as markers?
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.
Those are the GFM characters for the fenced code blocks.
Not sure what to 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.
don't mind my comment.. i wanted you to write that 0x7E
means ~
and 0x60
` but you already did that and i simply didn't understand your code.. I'm sorry for the supid 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.
Maybe something like:
// If the first character is not "open code blocks character " then return false
Seem redundant hahaha 😄
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.
hm.. i think you can just ignore my initial question and everything is fine :)
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.
LGTM 🎉
Description
The change fixes the issue with code blocks described in #2614.
The bug was introduced with the PR #2394 (by me 😱)
Issue fixed
Type of changes
Checklist: