Examples

The examples in this page serve a dual purpose: They act as unit tests, making it easy to spot bugs, and at the same time demonstrate what Prism can do, on simple and on edge cases.

Different markup

code.language-css

p { color: red; }

pre.language-css > code

p { color: red; }

pre > code.language-css

p { color: red; }

pre.language-css > code.language-*

p { color: red; }

code.lang-css

p { color: red; }

pre.lang-css > code

p { color: red; }

pre > code

No language, should inherit .language-markup

<p>hi!</p>

code.language-*

No language, should inherit .language-markup

<p>hi!</p>

code.language-none

Should not be highlighted.

<p>hi!</p>

Per language examples