Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into gh-pages
* develop: v8.8.0 feat(core/highlight): allow highlighting code blocks (#1061) feat(worker/respec-worker): remove xquery, as no one uses it style: fix indenting feat: do syntax highlighting in web worker (closes #964) (#1060) chore(.snyk): did vulnerability check style: eslint fixes feat(core/markdown): remove xquery, as no one uses it feat(package): remove xquery, as no one uses it chore(package): update command-line-args to version 4.0.0 (#1059) chore(deps/highlight.js): add hightlight.js again chore(.gitignore): don't ignore highlight.js chore(package): update dependecies chore(package): update snyk to version 1.24.6 (#1056) chore(package): update snyk to version 1.24.5 (#1053) tests: run karma against build instead (#1049)
- Loading branch information
Showing
26 changed files
with
1,733 additions
and
116 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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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 +1,33 @@ | ||
// ReSpec Worker v0 | ||
// ReSpec Worker v0.1.0 | ||
"use strict"; | ||
importScripts("https://www.w3.org/Tools/respec/respec-highlight.js"); | ||
|
||
hljs.configure({ | ||
tabReplace: " ", // 2 spaces | ||
languages: [ | ||
"css", | ||
"http", | ||
"javascript", | ||
"json", | ||
"markdown", | ||
"xml", | ||
], | ||
}); | ||
|
||
self.addEventListener("message", function(e) { | ||
switch (e.data.action) { | ||
case "highlight": | ||
const code = e.data.code; | ||
const langs = e.data.languages.length ? e.data.languages : undefined; | ||
const result = self.hljs.highlightAuto(code, langs); | ||
const data = Object.assign({}, e.data, result); | ||
try { | ||
self.postMessage(data); | ||
} catch (err) { | ||
console.error("Could not transform some code?", err); | ||
// Post back the original unhighlighted code. | ||
const fallbackData = Object.assign({}, e.data, { value: e.data.code }); | ||
self.postMessage(fallbackData); | ||
} | ||
} | ||
}); |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.