-
-
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
Markdown text is escaped when two tags share the same prefix. #5635
Comments
zombie12138
added a commit
to zombie12138/hexo
that referenced
this issue
Feb 20, 2025
zombie12138
added a commit
to zombie12138/hexo
that referenced
this issue
Feb 20, 2025
I would like to address this issue by contributing code to Hexo. I have proposed two solutions:
Please indicate the preferred solution, and I will submit a corresponding PR. I welcome any feedback to refine these approaches. |
zombie12138
added a commit
to zombie12138/hexo
that referenced
this issue
Feb 20, 2025
zombie12138
added a commit
to zombie12138/hexo
that referenced
this issue
Feb 20, 2025
I'm not sure which one is better, but there isn't much difference between these two in terms of performance |
2 tasks
zombie12138
added a commit
to zombie12138/hexo
that referenced
this issue
Feb 23, 2025
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Check List
hexo version
to check)Expected behavior
The Post:
All Markdown content between the
ref
andendreferences
tags is rendered properly. And## Ref
is rendered as anh2
element.Actual behavior
All Markdown content between the ref and endreferences tags is escaped, resulting in unrendered text.
How to reproduce?
Is the problem still there under
Safe mode
?Yes
Your Node.js & npm version
Your Hexo and Plugin version
Your
package.json
Your site's
_config.yml
(Optional)Others
I discovered this bug is caused by the
escapeAllSwigTags
function:The
ref
andreferences
tags share the same prefix. WhenescapeAllSwigTags
usesendref
to identify block-level tags, all content between{% ref xxx %}
and{% endreferences %}
is incorrectly escaped, resulting in unrendered Markdown.This is clearly a bug:
end${plugin_name}
in text will also cause ambiguity.The text was updated successfully, but these errors were encountered: