zenn-markdown-html 0.1.154-alpha.0 → 0.1.154-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/utils/highlight.js +5 -5
- package/package.json +2 -2
package/lib/utils/highlight.js
CHANGED
|
@@ -309,22 +309,22 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
309
309
|
(0, _prismDiffHighlight.enableDiffHighlight)();
|
|
310
310
|
function highlightContent({
|
|
311
311
|
text,
|
|
312
|
-
|
|
312
|
+
prismGrammar,
|
|
313
313
|
langName,
|
|
314
314
|
hasDiff
|
|
315
315
|
}) {
|
|
316
|
-
if (
|
|
316
|
+
if (prismGrammar && langName) {
|
|
317
317
|
if (hasDiff) return _prismCore.default.highlight(text, _prismCore.default.languages.diff, `diff-${langName}`);
|
|
318
|
-
return _prismCore.default.highlight(text,
|
|
318
|
+
return _prismCore.default.highlight(text, prismGrammar, langName);
|
|
319
319
|
}
|
|
320
320
|
if (hasDiff) return _prismCore.default.highlight(text, _prismCore.default.languages.diff, 'diff');
|
|
321
321
|
return (0, _utils.escapeHtml)(text);
|
|
322
322
|
}
|
|
323
323
|
function highlight(text, langName, hasDiff) {
|
|
324
|
-
const
|
|
324
|
+
const prismGrammar = _prismCore.default.languages[langName];
|
|
325
325
|
return highlightContent({
|
|
326
326
|
text,
|
|
327
|
-
|
|
327
|
+
prismGrammar,
|
|
328
328
|
langName,
|
|
329
329
|
hasDiff
|
|
330
330
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zenn-markdown-html",
|
|
3
|
-
"version": "0.1.154-alpha.
|
|
3
|
+
"version": "0.1.154-alpha.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Convert markdown to zenn flavor html.",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"prismjs": "^1.29.0",
|
|
59
59
|
"sanitize-html": "^2.9.0"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "9cd8a2f9fba6a5ec68e2b8189832d61b646e5538",
|
|
62
62
|
"publishConfig": {
|
|
63
63
|
"access": "public"
|
|
64
64
|
}
|