Update 2-ui/99-ui-misc/01-mutation-observer/article.md
Co-authored-by: Muhammed Zakir <8190126+MuhammedZakir@users.noreply.github.com>
This commit is contained in:
parent
4830a26deb
commit
d92984129c
1 changed files with 1 additions and 1 deletions
|
@ -128,7 +128,7 @@ Such snippet in an HTML markup looks like this:
|
|||
...
|
||||
```
|
||||
|
||||
Also we'll use a JavaScript highlighting library on our site, e.g. [Prism.js](https://prismjs.com/). A call to `Prism.highlightElem(pre)` examines the contents of such `pre` elements and adds into them special tags and styles for colored syntax highlighting, similar to what you see in examples here, on this page.
|
||||
For better readability and at the same time, to beautify it, we'll be using a JavaScript syntax highlighting library on our site, like [Prism.js](https://prismjs.com/). To get syntax highlighting for above snippet in Prism, `Prism.highlightElem(pre)` is called, which examines the contents of such `pre` elements and adds special tags and styles for colored syntax highlighting into those elements, similar to what you see in examples here, on this page.
|
||||
|
||||
When exactly should we run that highlighting method? We can do it on `DOMContentLoaded` event, or at the bottom of the page. At that moment we have our DOM ready, we can search for elements `pre[class*="language"]` and call `Prism.highlightElem` on them:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue