Skip to content

Commit 994a25d

Browse files
committed
Chore: update highlightjs syntax
See highlightjs/highlight.js#2277 Also updates vf-component-libary to 11ty 0.12.1
1 parent fdedf95 commit 994a25d

File tree

7 files changed

+19
-13
lines changed

7 files changed

+19
-13
lines changed

tools/vf-component-library/CHANGELOG.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
### 1.2.0
1+
### 1.1.0
22

33
* Adds the form options as their own set of components in the list.
44
* https://github.com/visual-framework/vf-core/pull/1390/files
5+
* Updates to use 11ty 0.12.1
6+
*
57

6-
### 1.1.0
8+
### 1.0.24
79

810
* changes the `vf-intro` so it's a white background, removes the padding.
911
* changes the links in `vf-intro` to be the 'correct' buttons.

tools/vf-component-library/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
],
2525
"private": false,
2626
"dependencies": {
27-
"@11ty/eleventy": "0.11.1",
27+
"@11ty/eleventy": "0.12.1",
2828
"@visual-framework/vf-config": "^1.0.1-alpha.0",
2929
"@visual-framework/vf-core": "^2.2.19",
3030
"@visual-framework/vf-extensions": "^1.0.0-rc.0",

tools/vf-extensions/CHANGELOG.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
# Change Log
1+
### 1.0.0-rc.1
22

3-
## 1.0.0-rc.0
3+
* Updates highlightjs syntax of render and codeblock tags
4+
* https://github.com/highlightjs/highlight.js/issues/2277
5+
6+
### 1.0.0-rc.0
47

58
* Improve Eleventy-Fractal integration to avoid unnecessary Eleventy rebuilds on Sass and JS updates.
69
* https://github.com/visual-framework/vf-core/pull/1309
710

8-
## 1.0.0-alpha.9
11+
### 1.0.0-alpha.9
912

1013
* Update documentation note on pointing to `gulp-build-search-index.js`
1114
* Search indexer now removes html areas wrapped in `class="vf-search-client-side--no-index"`

tools/vf-extensions/tags/codeblock.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@ const hljs = require('highlight.js');
44

55
// Return a block of syntax as code with style formatting
66
// uses: https://highlightjs.org/
7-
87
// Sample:
98
// {% codeblock 'html' -%}
109
// <link rel="stylesheet" href="https://dev.assets.emblstatic.net/vf/develop/css/styles.css">
1110
// <script src="https://dev.assets.emblstatic.net/vf/develop/scripts/scripts.js"></script>
1211
// {% endcodeblock %}
1312

1413
module.exports = function(nunjucksEngine,fractal){
15-
1614
function codeblockExtension() {
1715

1816
this.tags = ['codeblock'];
@@ -36,13 +34,11 @@ module.exports = function(nunjucksEngine,fractal){
3634
// let format = format || 'html'; // if format is not set, use "html"
3735
let txt = body();
3836
if(typeof txt == "undefined") return;
39-
txt = hljs.highlight(format, txt).value;
37+
txt = hljs.highlight(txt, {language: format, ignoreIllegals: true }).value;
4038

4139
return new nunjucksEngine.runtime.SafeString(`<pre class="vf-code-example__pre"><code class="Code Code--lang-${format} vf-code-example">${txt}</code></pre>`);
4240
};
4341

4442
};
45-
4643
return new codeblockExtension();
47-
4844
};

tools/vf-extensions/tags/render.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ module.exports = function (nunjucksEngine,fractal) {
6161
}
6262
if (highlight) {
6363
const hljs = require('highlight.js');
64-
html = hljs.highlight(codetype, html).value;
64+
html = hljs.highlight(html, {language: codetype, ignoreIllegals: true }).value;
6565
}
6666
if (escape) {
6767
// escaped by default, so just don't pass a safe string
+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
### 1.0.1
2+
3+
* Updates highlightjs syntax of codeblock tag
4+
* https://github.com/highlightjs/highlight.js/issues/2277
5+
16
### 1.0.0
27

38
- Initial release to be used with vf-core 2.2.0

tools/vf-frctl-extensions/codeblock.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ module.exports = function(fractal){
3636
// let format = format || 'html'; // if format is not set, use "html"
3737
let txt = body();
3838
if(typeof txt == "undefined") return;
39-
txt = hljs.highlight(format, txt).value;
39+
txt = hljs.highlight(txt, {language: format, ignoreIllegals: true }).value;
4040

4141
return `<pre class="vf-code-example__pre"><code class="Code Code--lang-${format} vf-code-example">${txt}</code></pre>`;
4242
};

0 commit comments

Comments
 (0)