1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
Description: Fixes for building highlight.js.
- Backport to highlight.js 9, which is the version still in Debian.
Author: Doug Torrance <dtorrance@debian.org>
Forwarded: not-needed
Last-Update: 2022-05-16
--- a/M2/Macaulay2/editors/highlightjs/index.js
+++ b/M2/Macaulay2/editors/highlightjs/index.js
@@ -1,8 +1,11 @@
-import hljs from 'highlight.js/lib/core';
+import hljs from 'highlight.js/lib/highlight';
import macaulay2 from './macaulay2.js';
import 'highlight.js/styles/default.css';
import './highlight-override.css';
hljs.registerLanguage('macaulay2', macaulay2);
-hljs.configure({ cssSelector: 'code' });
-hljs.highlightAll();
+document.addEventListener('DOMContentLoaded', (event) => {
+ document.querySelectorAll('code').forEach((block) => {
+ hljs.highlightBlock(block);
+ });
+});
--- a/M2/Macaulay2/editors/highlightjs/macaulay2.js.in
+++ b/M2/Macaulay2/editors/highlightjs/macaulay2.js.in
@@ -28,16 +28,16 @@
keywords: {
keyword: [
@M2KEYWORDS@
- ],
+ ].join(" "),
type: [
@M2DATATYPES@
- ],
+ ].join(" "),
built_in: [
@M2FUNCTIONS@
- ],
+ ].join(" "),
literal: [
@M2CONSTANTS@
- ]
+ ].join(" ")
}
}
}
|