-
-
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
fix(#4460): refactor post escape #4472
Conversation
We should also suggret user stick to |
Yes, the HTML escaping issue may destroy the structure of the entire page. |
Syntax highlight still says highlight,js is the default. Configuration page hasn't mention prism yet. Do you want to switch the priority? hexo/lib/plugins/filter/before_post_render/backtick_code_block.js Lines 53 to 64 in b7d15b9
|
如果书写codeblock在列表下,会同时出现‘<!–hexoPostRenderEscape:’ 和‘:hexoPostRenderEscape–>’
测试代码
|
May I have your # _config.yml
prismjs:
enable: true Have you tested this PR? |
I test the pr. it solved.
the setting
|
@curbengh No worry, only |
Since the |
Rendered fine for me. I noticed you had an extra triple backtick at the last line. |
@jerryc127 Would you mind update your status at #4460 instead? The PR is mainly focused on fixing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WFM
What does it do?
Basically the PR is reverting #4254.
Given a code block like this:
backtick_code_block
will useprismjs
to convert the code block into html:<!--hexoPostRenderEscape:
&:hexoPostRenderEscape-->
is added by Hexo to avoid missing paragraph issue.However, instead of ignoring the comment,
marked.js.org
will add extra<p>
tag:With extra
<p>
tag the code block is now broken and:hexoPostRenderEscape-->
can not be matched & removed.So to prevent
marked.js
from breaking the html, the PR reverts the behavior introduced by #4254The performance is not affected.
How to test
Screenshots
Pull request tasks
cc @jerryc127.