feat: 优化highlight行数显示
This commit is contained in:
parent
1555c24441
commit
12f48a99ad
|
@ -8,11 +8,16 @@ importScripts('https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.16.2/build/
|
|||
onmessage = function (event) {
|
||||
var data = JSON.parse(event.data);
|
||||
|
||||
try {
|
||||
var result = self.hljs.highlight(data.lang, data.code);
|
||||
} catch (e) {
|
||||
var result = self.hljs.highlightAuto(data.code);
|
||||
}
|
||||
|
||||
postMessage(JSON.stringify({
|
||||
result: {
|
||||
value: result.value,
|
||||
language: result.language,
|
||||
}, index: data.index
|
||||
}));
|
||||
};
|
||||
|
|
|
@ -194,6 +194,10 @@ table.hljs-ln,
|
|||
border: none;
|
||||
}
|
||||
|
||||
.hljs-ln td.hljs-ln-code:after {
|
||||
content: " ";
|
||||
}
|
||||
|
||||
td.hljs-ln-numbers {
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
|
|
Loading…
Reference in New Issue