stable

Clone or download

Read-only

Load Prism only when needed and limit the syntax highlighting to a specific element

Prism does not interact with the whole page anymore so we only do the syntax highlighting of elements that are in the viewport. Part of request #20075: Syntax highlights fenced code blocks in artifacts Change-Id: I24df9312ecf932a5c488b6b5887bc1a9fa98dc29

Modified Files

Name
A src/scripts/syntax-highlight/prism.test.ts +31 −0 Go to diff View file
A src/scripts/syntax-highlight/prism.ts +159 −0 Go to diff View file
M src/scripts/syntax-highlight/syntax-highlight-element.test.ts +14 −10 Go to diff View file
M src/scripts/syntax-highlight/syntax-highlight-element.ts +9 −141 Go to diff View file
M src/tsconfig.json +1 −0 Go to diff View file