mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 22:09:52 +08:00
highlighter: bug fix about HTML comments inside a fenced code block
This commit is contained in:
parent
a2670903cf
commit
d59a1010c5
@ -169,8 +169,13 @@ void HGMarkdownHighlighter::highlightBlock(const QString &text)
|
|||||||
// Set current block's user data.
|
// Set current block's user data.
|
||||||
updateBlockUserData(blockNum, text);
|
updateBlockUserData(blockNum, text);
|
||||||
|
|
||||||
|
int preState = previousBlockState();
|
||||||
|
bool inCodeblock = preState == HighlightBlockState::CodeBlock
|
||||||
|
|| preState == HighlightBlockState::CodeBlockStart;
|
||||||
|
|
||||||
// If it is a block inside HTML comment, just skip it.
|
// If it is a block inside HTML comment, just skip it.
|
||||||
if (isBlockInsideCommentRegion(curBlock)) {
|
// Pay attention to distinguish the HTML comments inside a fenced code block.
|
||||||
|
if (!inCodeblock && isBlockInsideCommentRegion(curBlock)) {
|
||||||
setCurrentBlockState(HighlightBlockState::Comment);
|
setCurrentBlockState(HighlightBlockState::Comment);
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user