Skip to content

Commit 9b0a2c5

Browse files
peachesontourMuhammedZakir
authored andcommitted
Update 2-ui/99-ui-misc/01-mutation-observer/article.md
Co-authored-by: Muhammed Zakir <8190126+MuhammedZakir@users.noreply.github.com>
1 parent 0de8774 commit 9b0a2c5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

2-ui/99-ui-misc/01-mutation-observer/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Such snippet in an HTML markup looks like this:
128128
...
129129
```
130130

131-
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.
131+
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.
132132

133133
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:
134134

0 commit comments

Comments
 (0)