Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

Commit

Permalink
feat(core/highlight): allow highlighting code blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoscaceres committed Feb 1, 2017
1 parent 1f5f7cf commit 2efcf03
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/highlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export async function run(conf, doc, cb) {

const promisesToHighlight = Array
.from(
doc.querySelectorAll("pre:not(.idl):not(.highlightdone)")
doc.querySelectorAll("pre:not(.idl):not(.nohighlight),code.highlight")
)
.map(element => {
return new Promise((resolve, reject) => {
Expand All @@ -66,7 +66,9 @@ export async function run(conf, doc, cb) {
}
worker.removeEventListener("message", listener);
element.innerHTML = ev.data.value;
element.classList.add("hljs");
if (element.localName === "pre") {
element.classList.add("hljs");
}
resolve();
});
setTimeout(() => {
Expand Down

0 comments on commit 2efcf03

Please sign in to comment.