Skip to content

Commit

Permalink
feat: 支持行内代码块样式
Browse files Browse the repository at this point in the history
  • Loading branch information
AirboZH committed Sep 13, 2023
1 parent 0561dcc commit 5534780
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/js/modules/layouts/basic.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { back2top } from '../components/back-to-top';
import { loadTooptip } from '../components/tooltip-loader';
import { codeClass } from '../../patch';

export function basic() {
back2top();
loadTooptip();
codeClass();
}
9 changes: 9 additions & 0 deletions src/js/patch/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export function codeClass() {
document.addEventListener('DOMContentLoaded', function () {
const codeElements = document.querySelectorAll('p code');

codeElements.forEach(function (codeElement) {
codeElement.classList.add('language-plaintext', 'highlighter-rouge');
});
});
}

0 comments on commit 5534780

Please sign in to comment.