hexo-starter icon indicating copy to clipboard operation
hexo-starter copied to clipboard

Switch to markdown-it

Open tomap opened this issue 2 years ago • 5 comments

and update other plugins

Following security issue on hexo-renderer-marked: https://github.com/hexojs/hexo-renderer-marked/pull/210

tomap avatar Sep 26 '21 13:09 tomap

Ready to be merged :)

tomap avatar Jan 08 '22 08:01 tomap

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.

yoshinorin avatar Jan 09 '22 06:01 yoshinorin

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

tomap avatar Jan 09 '22 11:01 tomap

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.

SukkaW avatar Jan 09 '22 12:01 SukkaW

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

tomap avatar Jan 10 '22 20:01 tomap