Skip to content

Commit

Permalink
fix: 解决 pjax 会重复加载同一个 style 的问题 (#398)
Browse files Browse the repository at this point in the history
* fix: 解决 pjax 会重复加载同一个 style 的问题

* fix: 解决 pjax 会重复加载同一个 style 的问题
  • Loading branch information
LIlGG authored Jul 27, 2023
1 parent 6c9ab3c commit 73e4796
Show file tree
Hide file tree
Showing 3 changed files with 128 additions and 9 deletions.
4 changes: 4 additions & 0 deletions src/libs/highlightjs-line-numbers.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,11 @@ export function registerHljsLineNumbers(hljs) {
}

export function injectHljsLineNumbersCss() {
if (document.getElementById("hljs-ln-css")) {
return;
}
const css = window.document.createElement("style");
css.id = "hljs-ln-css";
css.innerHTML = `
.${TABLE_NAME}{border-collapse:collapse}
.${TABLE_NAME} td{padding:0}
Expand Down
2 changes: 1 addition & 1 deletion templates/assets/dist/css/main.min.css

Large diffs are not rendered by default.

Loading

0 comments on commit 73e4796

Please sign in to comment.