Skip to content
This repository was archived by the owner on Jun 8, 2026. It is now read-only.

Commit ab69e44

Browse files
committed
fix(transform): modifying transform to match linting rules
1 parent c75f904 commit ab69e44

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

src/ext/MarkdownTransformer.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1263,6 +1263,17 @@ function omitPlatformSpecificSections(options: any) {
12631263
options.toDelete.add(parent.children[index]);
12641264
}
12651265
break;
1266+
} else if (platformsEqual(currPlats, segment.platforms) && segment.platforms.indexOf(options.platform) != -1) {
1267+
// platform matches: keep content but remove the comment markers
1268+
parent.children[checkIndex].value = parent.children[checkIndex].value.substring(0, startSeg.startIndex);
1269+
if (parent.children[checkIndex].value.length == 0) {
1270+
options.toDelete.add(parent.children[checkIndex]);
1271+
}
1272+
parent.children[index].value = parent.children[index].value.substring(segment.endIndex);
1273+
if (parent.children[index].value.length == 0) {
1274+
options.toDelete.add(parent.children[index]);
1275+
}
1276+
break;
12661277
}
12671278
}
12681279
}
@@ -1809,7 +1820,7 @@ export class MarkdownTransformer {
18091820
.use(finishRemoveBlocks, options)
18101821
.use(transformNotes, options)
18111822
.use(finishRemoveNotes, options)
1812-
.use(stringify)
1823+
.use(stringify, { rule: '-', ruleRepetition: 3, ruleSpaces: false, emphasis: '_', fences: true })
18131824
.process(fileContent, function(err: any, vfile: any) {
18141825
if (err) {
18151826
callback(err, null);
@@ -1821,6 +1832,7 @@ export class MarkdownTransformer {
18211832
fileContent = fileContent.split("* ").join("- ").split("* ").join("- "); // unordered lists: "* " -> "- "
18221833
fileContent = fileContent.split(" - ").join(" - ").split(" - ").join(" - "); // no extra indent
18231834
fileContent = fileContent.split(". ").join(". "); // no extra space after item of ordered list
1835+
fileContent = fileContent.split("\\[!").join("[!"); // note blocks: remark-stringify escapes "[" in "[!NOTE]" as "\[!NOTE]"
18241836

18251837
output.push({ content: fileContent, componentOutput: componentOutput });
18261838

0 commit comments

Comments
 (0)