-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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 blocks in HTML comments were incorrectly converted #5433
Comments
I have found the reason. By the way, I have read an article about code blocks https://hexo.io/docs/syntax-highlight.html#How-to-use-code-block-in-posts. It says code block syntax will always be available, so I did additional tests. Syntax highlighting is disabled. Source:
Output:
I should edit the title. |
hexo wraps the highlighting code in <! -- --> and passes it into the markdown renderer, making it difficult to deal with nested comments. Line 42 in 3c7729d
Notice that the end of the comment is escaped as <p>-></p> , causing a comment tag pairing failure.
|
Check List
hexo version
to check)Expected behavior
In my old blog directory (replaced theme with landscape):
Output:
Actual behavior
In my newly installed blog directory:
Output:
How to reproduce?
Write a post like this and then start the server:
Is the problem still there under
Safe mode
?Cannot generate pages under safe mode.
Your Node.js & npm version
Your Hexo and Plugin version
Your
package.json
Your site's
_config.yml
(Optional)No response
Others
Additionally, here is a list of plugins used in my OLD environment:
When I was trying to setup a new environment, this issue appeared. I don't know why.
The text was updated successfully, but these errors were encountered: