-
Notifications
You must be signed in to change notification settings - Fork 17
Advanced usage
matubu edited this page Jan 8, 2022
·
3 revisions
You can use the highlightElement
to allow better control what and when to highlight elements,
For example, here’s the equivalent of highlightAll
:
document
.querySelectorAll('[class*="shj-lang-"]')
.forEach(elm => highlightElement(elm));
The highlightElement
can also take the language
and the layout mode
of element to highlight:
highlightElement(elm, '[language]', '[multi|in|one]line')
- The class
shj-mode-header
will add a header with the language name