From 4b1840e6437504d559b644110eae0262761c972d Mon Sep 17 00:00:00 2001 From: Sia Date: Fri, 12 Oct 2018 12:48:54 -0500 Subject: [PATCH] Add the `langPrefix` option to the highlight syntax example --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 4cbcbb14..da0de403 100644 --- a/README.md +++ b/README.md @@ -164,6 +164,7 @@ var hljs = require('highlight.js') // https://highlightjs.org/ // Actual default values var md = new Remarkable({ + langPrefix: 'hljs language-', highlight: function (str, lang) { if (lang && hljs.getLanguage(lang)) { try { @@ -180,6 +181,7 @@ var md = new Remarkable({ }); ``` +The `langPrefix` option is required to pass the `hljs` class to the code block so that the full Highlight.js styles are applied correctly. Note that it will only work if [your fenced code block has params set, like a language param](https://github.com/jonschlinkert/remarkable/issues/224#issuecomment-339686207). ### Syntax extensions