zenn-markdown-html 0.2.12-alpha.1 → 0.2.12-alpha.3
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.
|
@@ -248,9 +248,11 @@ async function applyHighlighting(html, codeBlocks) {
|
|
|
248
248
|
}));
|
|
249
249
|
|
|
250
250
|
// プレースホルダーを置換
|
|
251
|
+
// 注: replace の第2引数を関数にすることで、$' や $` などの
|
|
252
|
+
// 特殊パターン解釈を防ぐ(コードブロック内に $ が含まれる場合の対策)
|
|
251
253
|
let result = html;
|
|
252
254
|
for (let i = 0; i < highlightedBlocks.length; i++) {
|
|
253
|
-
result = result.replace(codeBlocks[i].placeholder, highlightedBlocks[i]);
|
|
255
|
+
result = result.replace(codeBlocks[i].placeholder, () => highlightedBlocks[i]);
|
|
254
256
|
}
|
|
255
257
|
return result;
|
|
256
258
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zenn-markdown-html",
|
|
3
|
-
"version": "0.2.12-alpha.
|
|
3
|
+
"version": "0.2.12-alpha.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Convert markdown to zenn flavor html.",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"sanitize-html": "^2.17.0",
|
|
63
63
|
"shiki": "^1.24.0"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "6ddd42d0cc782fa2556e1e3505a61f414053ce3d",
|
|
66
66
|
"publishConfig": {
|
|
67
67
|
"access": "public"
|
|
68
68
|
}
|