mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-26 02:51:04 +00:00
Merge pull request #3636 from flozz/syntax-highlight
Highlight code in articles using highlight.js
This commit is contained in:
commit
36054f5dd4
3 changed files with 12 additions and 1 deletions
|
@ -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);
|
||||
});
|
||||
});
|
|
@ -65,6 +65,7 @@
|
|||
"dependencies": {
|
||||
"annotator": "git://github.com/wallabag/annotator.git#0f076c7d371ed25eb0793346f46982d90f2c4c85",
|
||||
"hammerjs": "^2.0.8",
|
||||
"highlight.js": "^9.12.0",
|
||||
"icomoon-free-npm": "^0.0.0",
|
||||
"jquery": "^2.1.4",
|
||||
"jquery.cookie": "^1.4.1",
|
||||
|
|
Loading…
Reference in a new issue