@brillout/docpress 0.16.8 → 0.16.10
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/Layout.tsx
CHANGED
|
@@ -170,8 +170,8 @@ function cleanUpCode(code: string, isJsCode: boolean = false) {
|
|
|
170
170
|
return processMagicComments(code)
|
|
171
171
|
}
|
|
172
172
|
function processMagicComments(code: string) {
|
|
173
|
-
// @
|
|
174
|
-
const renameCommentRE = /^\s*\/\/\s@
|
|
173
|
+
// @docpress-replace DummyLayout Layout
|
|
174
|
+
const renameCommentRE = /^\s*\/\/\s@docpress-replace\s([^ ]+) ([^ ]+)\n/gm
|
|
175
175
|
const matches = Array.from(code.matchAll(renameCommentRE))
|
|
176
176
|
|
|
177
177
|
if (matches.length) {
|
|
@@ -181,7 +181,7 @@ function processMagicComments(code: string) {
|
|
|
181
181
|
code = code.split(fullMatch).join('').replaceAll(renameFrom, renameTo)
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
|
-
code = code.replaceAll('// @
|
|
184
|
+
code = code.replaceAll('// @docpress-uncomment ', '')
|
|
185
185
|
|
|
186
186
|
return code
|
|
187
187
|
}
|
|
@@ -142,8 +142,8 @@ function cleanUpCode(code, isJsCode = false) {
|
|
|
142
142
|
return processMagicComments(code);
|
|
143
143
|
}
|
|
144
144
|
function processMagicComments(code) {
|
|
145
|
-
// @
|
|
146
|
-
const renameCommentRE = /^\s*\/\/\s@
|
|
145
|
+
// @docpress-replace DummyLayout Layout
|
|
146
|
+
const renameCommentRE = /^\s*\/\/\s@docpress-replace\s([^ ]+) ([^ ]+)\n/gm;
|
|
147
147
|
const matches = Array.from(code.matchAll(renameCommentRE));
|
|
148
148
|
if (matches.length) {
|
|
149
149
|
for (let i = matches.length - 1; i >= 0; i--) {
|
|
@@ -152,7 +152,7 @@ function processMagicComments(code) {
|
|
|
152
152
|
code = code.split(fullMatch).join('').replaceAll(renameFrom, renameTo);
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
code = code.replaceAll('// @
|
|
155
|
+
code = code.replaceAll('// @docpress-uncomment ', '');
|
|
156
156
|
return code;
|
|
157
157
|
}
|
|
158
158
|
/**
|