bedazzlr 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +4 -4
- package/package.json +6 -6
package/lib/index.js
CHANGED
|
@@ -84,7 +84,6 @@ const countIndents = (root) => {
|
|
|
84
84
|
}
|
|
85
85
|
return indents;
|
|
86
86
|
} else {
|
|
87
|
-
if (el.tagName === 'A') debugger;
|
|
88
87
|
el =
|
|
89
88
|
el.previousElementSibling ||
|
|
90
89
|
(el.parentElement.tagName === 'NODE' ? el.parentElement : null);
|
|
@@ -117,9 +116,9 @@ export const removeDocumentListeners = () => {
|
|
|
117
116
|
}
|
|
118
117
|
};
|
|
119
118
|
|
|
120
|
-
export const highlightCode = (el, language, matcher = language.defaultMatcher) => {
|
|
119
|
+
export const highlightCode = (el, language, matcher = language.defaultMatcher, options) => {
|
|
121
120
|
let tags = hoistTrivia(
|
|
122
|
-
streamParse(language, matcher, el.innerText, null, { holdShiftedNodes: true }),
|
|
121
|
+
streamParse(language, matcher, el.innerText, null, { ...options, holdShiftedNodes: true }),
|
|
123
122
|
)[Symbol.iterator]();
|
|
124
123
|
|
|
125
124
|
let open;
|
|
@@ -475,7 +474,7 @@ export const highlightCode = (el, language, matcher = language.defaultMatcher) =
|
|
|
475
474
|
});
|
|
476
475
|
};
|
|
477
476
|
|
|
478
|
-
export const highlightAll = (languages) => {
|
|
477
|
+
export const highlightAll = (languages, options) => {
|
|
479
478
|
let codeBlocks = document.querySelectorAll('code');
|
|
480
479
|
|
|
481
480
|
for (let block of codeBlocks) {
|
|
@@ -503,6 +502,7 @@ export const highlightAll = (languages) => {
|
|
|
503
502
|
),
|
|
504
503
|
)
|
|
505
504
|
: language.defaultMatcher,
|
|
505
|
+
options,
|
|
506
506
|
);
|
|
507
507
|
} catch (e) {
|
|
508
508
|
console.warn(e);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bedazzlr",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "Code block syntax highlighting using BABLR",
|
|
5
5
|
"author": "Conrad Buck<conartist6@gmail.com>",
|
|
6
6
|
"type": "module",
|
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
"test": "mocha test/*.test.js"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@bablr/agast-helpers": "0.10.
|
|
19
|
-
"@bablr/agast-vm-helpers": "0.10.
|
|
20
|
-
"@bablr/boot": "0.11.
|
|
21
|
-
"@bablr/helpers": "0.25.
|
|
18
|
+
"@bablr/agast-helpers": "0.10.4",
|
|
19
|
+
"@bablr/agast-vm-helpers": "0.10.4",
|
|
20
|
+
"@bablr/boot": "0.11.3",
|
|
21
|
+
"@bablr/helpers": "0.25.2",
|
|
22
22
|
"@iter-tools/imm-stack": "1.2.0",
|
|
23
|
-
"bablr": "0.11.
|
|
23
|
+
"bablr": "0.11.3",
|
|
24
24
|
"classnames": "2.5.1"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|