@farming-labs/nuxt-theme 0.1.10 → 0.1.12
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farming-labs/nuxt-theme",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.12",
|
|
4
4
|
"description": "Nuxt/Vue UI components for @farming-labs/docs — layout, sidebar, TOC, search, and theme toggle",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"docs",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
},
|
|
82
82
|
"dependencies": {
|
|
83
83
|
"sugar-high": "^0.9.5",
|
|
84
|
-
"@farming-labs/docs": "0.1.
|
|
84
|
+
"@farming-labs/docs": "0.1.12"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
87
|
"nuxt": ">=3.0.0",
|
|
@@ -59,6 +59,11 @@ function renderTable(rows) {
|
|
|
59
59
|
export function renderMarkdown(text) {
|
|
60
60
|
if (!text) return "";
|
|
61
61
|
|
|
62
|
+
const codeBlockTokenBoundary = String.fromCharCode(0);
|
|
63
|
+
const codeBlockTokenPattern = new RegExp(
|
|
64
|
+
`${codeBlockTokenBoundary}CB(\\d+)${codeBlockTokenBoundary}`,
|
|
65
|
+
"g",
|
|
66
|
+
);
|
|
62
67
|
const codeBlocks = [];
|
|
63
68
|
|
|
64
69
|
let processed = text.replace(/```(\w*)\n([\s\S]*?)```/g, (_match, lang, code) => {
|
|
@@ -112,7 +117,7 @@ export function renderMarkdown(text) {
|
|
|
112
117
|
.replace(/\n\n/g, '<div style="height:8px"></div>')
|
|
113
118
|
.replace(/\n/g, "<br>");
|
|
114
119
|
|
|
115
|
-
result = result.replace(
|
|
120
|
+
result = result.replace(codeBlockTokenPattern, (_m, idx) => codeBlocks[Number(idx)]);
|
|
116
121
|
|
|
117
122
|
return result;
|
|
118
123
|
}
|