mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00
fix highlightjs bug with code block
We should distinguish <code> and <pre><code>. Signed-off-by: Le Tan <tamlokveer@gmail.com>
This commit is contained in:
parent
dce6396874
commit
3d6778e1fe
@ -26,7 +26,9 @@
|
||||
|
||||
var codes = document.getElementsByTagName('code');
|
||||
for (var i = 0; i < codes.length; ++i) {
|
||||
hljs.highlightBlock(codes[i]);
|
||||
if (codes[i].parentElement.tagName.toLowerCase() == 'pre') {
|
||||
hljs.highlightBlock(codes[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user