forked from wallabag/wallabag
Highlight code in articles using highlight.js
This commit is contained in:
@ -13,8 +13,10 @@ import './global.scss';
|
||||
import './js/shortcuts/entry';
|
||||
import './js/shortcuts/main';
|
||||
|
||||
import { savePercent, retrievePercent } from './js/tools';
|
||||
/* Hightlight */
|
||||
import './js/highlight';
|
||||
|
||||
import { savePercent, retrievePercent } from './js/tools';
|
||||
|
||||
/* ==========================================================================
|
||||
Annotations & Remember position
|
||||
|
||||
8
app/Resources/static/themes/_global/js/highlight.js
Normal file
8
app/Resources/static/themes/_global/js/highlight.js
Normal file
@ -0,0 +1,8 @@
|
||||
import 'highlight.js/styles/atom-one-light.css';
|
||||
import * as hljs from 'highlight.js';
|
||||
|
||||
window.addEventListener('load', () => {
|
||||
document.querySelectorAll('pre').forEach((node) => {
|
||||
hljs.highlightBlock(node);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user