Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
code block in markdown are not rendered correctly after set disableNunjucks to true #3573
Fix the issue that code blocks in markdown are rendered as placeholder after disabling nunjucks
What does it do?
Fix the issue that "code block in markdown are not rendered correctly after set
How to test
(1) Hexo Test
git clone -b master https://github.com/think-in-universe/hexo.git cd hexo npm install npm test # passed in my local test
(2) Test "Disable Nunjucks" At Renderer-Level
git clone -b master https://github.com/think-in-universe/hexo-stop-tag-plugins.git cd hexo-stop-tag-plugins npm install npm test # 4 of 11 test failed npm install think-in-universe/hexo#master # override the hexo package npm test # 11 or 11 tests passed, after include the change in this PR
Pull request tasks
1 similar comment
This was referenced
Jun 4, 2019
Hi, why go to the trouble of disabling nunjucks, instead of using the raw tag?
I haven't tested it, but that could help, isn't it?
@tomap I think there're already numerous discussion about disabling nunjucks, such as:
For my use case, I cannot change the markdown source code written by my friends (which are conflicted with nunjucks somehow), but I still want to help them to convert markdown into HTML pages, because I cannot force the writers to use nunjucks by modifying their source intensively.
From another perspective, the
For the design of hexo, I don't think "disabling nunjucks" is kind of trouble. On the contrary, it can provide more flexibility for hexo users/developers who want to use customized renderers.
For more questions, feel free to let me know.
@JLHwung, thanks for the suggestions.
Do you know where we can find the unit tests for the PR (#2593) that introduced the
I have several tests in https://github.com/think-in-universe/hexo-stop-tag-plugins, can we just reuse that tests and move some of them to hexo's unit tests?
@be5invis thanks for your quick response and review.
then we may add some tests in this PR, if @JLHwung can help check the tests in https://github.com/think-in-universe/hexo-stop-tag-plugins are feasible.