-
-
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
{% raw %} tags shown when mixed triple backtick and raw blocks are used with hljs #3543
Comments
Original (failing) PR: #3459 |
I found that https://github.com/hexojs/hexo/blob/master/lib/extend/tag.js#L118 str = str.replace(/<pre><code.*>[\s\S]*?<\/code><\/pre>/gm, escapeContent); This code eats all of the Why does the option When I investigate how correct this code (maybe just change RegExp to "non-greedy"). |
Above patch is not enough. For example, the following source text is not rendered well:
The part from 1st I continue to investigate more... |
In order to avoid errors caused by some conflicting writing in the code block with njk, like: \```html
<span>{{ aaa || bbb }}</span>
\``` Line 26 in 663f1eb
But I think this part of the code is bad, it is better to use {% raw%} |
@jiangtj Thank you for showing an example. But the example can not be handled by current Hexo I think codes for I still wonder why the code of |
We should not use |
On vuejs.org, we're encountering a weird issue where
{% raw %}
and{% endraw %}
tags are visible with a very specific set of settings.What does it do?
To reproduce the bug with minimal settings.
How to test
You'll notice that with the provided stub (
content
) ANDhexo.config.highlight.hljs
set totrue
, hexo will leave the{% raw %}
and{% endraw %}
tags untouched, and the (only) test case will fail with this assertion error:Screenshots
None.
Pull request tasks
The text was updated successfully, but these errors were encountered: