-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
code block in markdown are not rendered correctly after set disableNunjucks to true #3573
Conversation
…r after disabling nunjucks
For "Add test cases for the changes.", what the recommended ways to add that? |
1 similar comment
hello, when will anyone look at this PR? @yoshinorin @weyusi |
Hi, why go to the trouble of disabling nunjucks, instead of using the raw tag? https://mozilla.github.io/nunjucks/templating.html#raw 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:
Using 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. |
@NoahDragon can you please also help review the change? I think the |
Hi think-in-universe, Sorry for the late reply. Could you add a unit test on the new behavior? It would help people evaluate the impact of behavior change. Thank you. |
@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? |
Hi @be5invis, Could you please also help review the change? I think |
For reviewers, I think this repo about youki is the place where @be5invis used the I didn't actually see much use case that used the |
@think-in-universe |
Also, |
@be5invis one of the issue we have with PR #2593, is that the code blocks in markdown are not rendered correctly with You may check hexo-stop-tag-plugins as an example. |
Different to the youki use case, where you don't use any markdown I think. @be5invis My and quite some others' use cases (as I shared above) are conflicted with nunjucks when writing markdowns. |
I don't think there's any problem with this PR. |
I don't think there's tests for that. |
@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. |
the tests shown in hexo-stop-tag-plugins looks extensive. I think incorporate them into test/scripts/hexo/post.js (since |
Another question: if the PR is merged, which release of hexo will include this change? |
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
disableNunjucks
to true", which is introduced in PR #2593Expected behavior:
disableNunjucks
to true ;How to test
(1) Hexo Test
(2) Test "Disable Nunjucks" At Renderer-Level
To test
disableNunjucks
, we can use the hexo-stop-tag-plugins plugin created by me. The plugin has been submitted to the plugins list via the PR hexojs/site#966Pull request tasks