-
-
Notifications
You must be signed in to change notification settings - Fork 59
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(highlight): code in blockquote #110
Conversation
html = html.replace(/>.*/g, (str) => { | ||
str = str.replace(/^>(\s)?(?!<\/span>)/, ''); | ||
return str; | ||
}).trimRight(); |
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.
this is a workaround to remove unnecessary new line from
>```
// https://github.com/hexojs/hexo/issues/2969 | ||
if (lang !== 'cmd' && lang !== 'dos') { | ||
html = html.replace(/>.*/g, (str) => { | ||
str = str.replace(/^>(\s)?(?!<\/span>)/, ''); |
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.
<span>
exclusion is a workaround to be compatible with sublanguage highlight.
In regards to https://github.com/hexojs/hexo-util/issues/108, it may be more suitable to put this workaround in backtick_code_block.js, but currently I'm not sure how well prism/atom handle blockquote. If later we find prism/atom cannot handle blockquote, then this workaround shall be moved to hexo. |
I think a workaround in the hexo (backtick_code_block.js) might be better I found examples of markdown notation in the GitHub Help: There are many examples which current As shown in Example 229, I'm trying to improve |
Superseded by hexojs/hexo#3765. |
Currently, when inserting a codeblock inside a blockquote, e.g.
results in,
Expected behavior is
This fixes hexojs/hexo#2969 & hexojs/hexo#3318.
However, this fix doesn't apply to
cmd
ordos
codeblock because the line may start with>
, e.g.cmd codeblock in blockquote,
would result in,
A workaround is to remove
>
from the closing backtick,https://pastebin.com/s94kaD4j
which should render as,
or use
{% blockquote %}
tag plugin.