-
Notifications
You must be signed in to change notification settings - Fork 2
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
move from marky-markdown to marked #6
Conversation
removed unused dependencies
@yigitakbulut code review welcome, if you have some spare time. No rush. |
debug: false, // console.log() all the things | ||
package: null // npm package metadata | ||
}); | ||
return marked(markdown); |
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.
Question, what about the removed options for marky, are we sure marked handles them properly?
Highlighting for sure handled by hl.js, what about the others?
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.
yes, we could add a comment to marked's default config values, which match our needs: https://marked.js.org/using_advanced#options
const renderer = { | ||
heading(text, level) { | ||
const escapedText = text.toLowerCase().replace(/[^\w]+/g, '-'); | ||
return '<h' + level + ' class="header"><a aria-hidden="true" id="' + |
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.
Could you explain why this change?
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.
This generates anchor links next to each h1/h2/h3 title.
The previous library did this automatically, this one needs a little hack.
@yigitakbulut I added comments |
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.
Good for me!
fixes #4