-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chore: update highlightjs syntax (#1435)
* Chore: update highlightjs syntax See highlightjs/highlight.js#2277 Also updates vf-component-libary to 11ty 0.12.1
- Loading branch information
1 parent
39063d6
commit 0925481
Showing
7 changed files
with
21 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
# Change Log | ||
### 1.0.0-rc.1 | ||
|
||
## 1.0.0-rc.0 | ||
* Updates highlightjs syntax of render and codeblock tags | ||
* https://github.com/visual-framework/vf-core/pull/1435 | ||
* https://github.com/highlightjs/highlight.js/issues/2277 | ||
|
||
### 1.0.0-rc.0 | ||
|
||
* Improve Eleventy-Fractal integration to avoid unnecessary Eleventy rebuilds on Sass and JS updates. | ||
* https://github.com/visual-framework/vf-core/pull/1309 | ||
|
||
## 1.0.0-alpha.9 | ||
### 1.0.0-alpha.9 | ||
|
||
* Update documentation note on pointing to `gulp-build-search-index.js` | ||
* Search indexer now removes html areas wrapped in `class="vf-search-client-side--no-index"` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,15 +4,13 @@ const hljs = require('highlight.js'); | |
|
||
// Return a block of syntax as code with style formatting | ||
// uses: https://highlightjs.org/ | ||
|
||
// Sample: | ||
// {% codeblock 'html' -%} | ||
// <link rel="stylesheet" href="https://dev.assets.emblstatic.net/vf/develop/css/styles.css"> | ||
// <script src="https://dev.assets.emblstatic.net/vf/develop/scripts/scripts.js"></script> | ||
// {% endcodeblock %} | ||
|
||
module.exports = function(nunjucksEngine,fractal){ | ||
|
||
function codeblockExtension() { | ||
|
||
this.tags = ['codeblock']; | ||
|
@@ -36,13 +34,11 @@ module.exports = function(nunjucksEngine,fractal){ | |
// let format = format || 'html'; // if format is not set, use "html" | ||
let txt = body(); | ||
if(typeof txt == "undefined") return; | ||
txt = hljs.highlight(format, txt).value; | ||
txt = hljs.highlight(txt, {language: format, ignoreIllegals: true }).value; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
khawkins98
Author
Contributor
|
||
|
||
return new nunjucksEngine.runtime.SafeString(`<pre class="vf-code-example__pre"><code class="Code Code--lang-${format} vf-code-example">${txt}</code></pre>`); | ||
}; | ||
|
||
}; | ||
|
||
return new codeblockExtension(); | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
### 1.0.1 | ||
|
||
* Updates highlightjs syntax of codeblock tag | ||
* https://github.com/visual-framework/vf-core/pull/1435 | ||
* https://github.com/highlightjs/highlight.js/issues/2277 | ||
|
||
### 1.0.0 | ||
|
||
- Initial release to be used with vf-core 2.2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The default for ignoreIllegals is false, so this is a change in behavior, just FYI. Now you are ignoring illegals where-as before you were not. Perhaps that was intentional. I dunno.