Skip to content

Commit

Permalink
Merge branch 'develop' into gh-pages
Browse files Browse the repository at this point in the history
* 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
marcoscaceres committed Feb 1, 2017
2 parents ce0f048 + a9a97c0 commit 4a818fe
Show file tree
Hide file tree
Showing 26 changed files with 1,733 additions and 116 deletions.
6 changes: 4 additions & 2 deletions .gitignore
Expand Up @@ -6,19 +6,21 @@ scratch
examples/touchevents.html
bevy.json
.idea
js/deps/
js/deps/*
!js/deps/highlight.js
js/**/*.map
js/core/base-runner.js
js/core/biblio-db.js
js/core/biblio.js
js/core/data-cite.js
js/core/data-include.js
js/core/default-root-attr.js
js/core/highlight.js
js/core/include-config.js
js/core/override-configuration.js
js/core/post-process.js
js/core/pre-process.js
js/core/pubsubhub.js
js/core/remove-respec.js
js/core/respec-ready.js
src/deps/*.js
js/core/worker.js
4 changes: 3 additions & 1 deletion .snyk
@@ -1,5 +1,7 @@
version: v1.5.0
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
version: v1.7.0
ignore: {}
# patches apply the minimum changes required to fix a vulnerability
patch:
'npm:marked:20150520':
- marked:
Expand Down
2 changes: 1 addition & 1 deletion builds/respec-w3c-common.build.js.map

Large diffs are not rendered by default.

27 changes: 13 additions & 14 deletions builds/respec-w3c-common.js

Large diffs are not rendered by default.

34 changes: 33 additions & 1 deletion builds/respec-worker.js
@@ -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);
}
}
});
44 changes: 0 additions & 44 deletions js/core/highlight.js

This file was deleted.

5 changes: 2 additions & 3 deletions js/core/markdown.js
Expand Up @@ -58,7 +58,6 @@ define([
"json",
"markdown",
"xml",
"xquery",
]);

hljs.configure({
Expand Down Expand Up @@ -271,8 +270,8 @@ define([
.replace(/\n\s*&quot;</mg, " &quot;<");
var beautifulHTML = beautify.html_beautify(cleanHTML, beautifyOps);
newBody.innerHTML = beautifulHTML;
// Remove links where class pre.nolinks
substituteWithTextNodes(newBody.querySelectorAll("pre.nolinks a[href]"));
// Remove links where class .nolinks
substituteWithTextNodes(newBody.querySelectorAll(".nolinks a[href]"));
// Restructure the document properly
var fragment = structure(newBody, doc);
// Frankenstein the whole thing back together
Expand Down

0 comments on commit 4a818fe

Please sign in to comment.