Skip to content

Switch to markdown-it#52

Open
tomap wants to merge 3 commits into
hexojs:masterfrom
tomap:feature/switchToMarkdown-it
Open

Switch to markdown-it#52
tomap wants to merge 3 commits into
hexojs:masterfrom
tomap:feature/switchToMarkdown-it

Conversation

@tomap

@tomap tomap commented Sep 26, 2021

Copy link
Copy Markdown

and update other plugins

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

@tomap

tomap commented Jan 8, 2022

Copy link
Copy Markdown
Author

Ready to be merged :)

@yoshinorin

Copy link
Copy Markdown
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

tomap commented Jan 9, 2022

Copy link
Copy Markdown
Author

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

SukkaW commented Jan 9, 2022

Copy link
Copy Markdown
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.

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

tomap commented Jan 10, 2022

Copy link
Copy Markdown
Author

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