Skip to content

Commit b96e487

Browse files
authored
Merge branch 'develop' into dependabot/npm_and_yarn/tar-4.4.15
2 parents 18fada5 + 72485a3 commit b96e487

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

docs/language-highlight.md

+10
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,13 @@ function getAdder(int $x): int
5151
return 123;
5252
}
5353
```
54+
55+
## Highlighting Dynamic Content
56+
Code blocks [dynamically created from javascript](https://docsify.js.org/#/configuration?id=executescript) can be highlighted using the method `Prism.highlightElement` like so:
57+
58+
```javascript
59+
var code = document.createElement("code");
60+
code.innerHTML = "console.log('Hello World!')";
61+
code.setAttribute("class", "lang-javascript");
62+
Prism.highlightElement(code);
63+
```

0 commit comments

Comments
 (0)