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

move from marky-markdown to marked #6

Merged
merged 2 commits into from
Oct 25, 2021
Merged

Conversation

davidrapin
Copy link
Contributor

fixes  #4

removed unused dependencies
@davidrapin davidrapin changed the title #4 moved from marky-markdown to marked move from marky-markdown to marked Oct 22, 2021
@davidrapin
Copy link
Contributor Author

@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);

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?

Copy link
Contributor Author

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="' +

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?

Copy link
Contributor Author

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.

@davidrapin
Copy link
Contributor Author

@yigitakbulut I added comments

Copy link

@yigitakbulut yigitakbulut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good for me!

@davidrapin davidrapin merged commit 225a76c into master Oct 25, 2021
@davidrapin davidrapin deleted the fix/4-move-to-marked branch October 25, 2021 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants