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

Switch to markdown-it #52

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

tomap
Copy link

@tomap tomap commented Sep 26, 2021

and update other plugins

Following security issue on hexo-renderer-marked: hexojs/hexo-renderer-marked#210

@tomap
Copy link
Author

tomap commented Jan 8, 2022

Ready to be merged :)

@yoshinorin
Copy link
Member

I think maybe no problem if we switch the default markdown parser from marked to markdown-it.
But, I want to know other maintainers' opinions. They may come up with some problems or issues.

@tomap
Copy link
Author

tomap commented Jan 9, 2022

Understood. The main reason is that marked has some security issues that markdown-it does not have.

There is no sanitizer in marked. You have to add it on top. But by default, markdown-it is safe

@SukkaW
Copy link
Member

SukkaW commented Jan 9, 2022

I think maybe no problem if we switch the default markdown parser from marked to markdown-it. But, I want to know other maintainers' opinions. They may come up with some problems or issues.

Personally, I prefer hexo-renderer-marked. The benchmark between hexo-renderer-markdown-it and hexo-renderer-marked is probably outdated (At least in my case, it is faster than hexo-renderer-markdown-it).

Also, we need to compare the differences between the output from hexo-renderer-marked and the output from hexo-renderer-markdown-it, to see if it is potentially a breaking change that breaks new users (especially with existing themes). And if there is any, we should defer it to Hexo 7.0.0.

That's to say, I am not against hexo-renderer-markdown-it, but more tests and preparations need to be done.

@tomap
Copy link
Author

tomap commented Jan 10, 2022

There is one. https://github.com/hexojs/hexo-renderer-marked#options

Autolink in marked will convert full url while the same feature in markdown-it will also convert urls
without scheme

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.

3 participants