{!ci && {name}
}
- {(strippedMarkdown !== null || showAst) && (
+ {(hasAnyStripped || showAst) && (
- {strippedMarkdown !== null && (
+ {hasAnyStripped && (
)}
- {stripError && (
-
-
stripComments error: {stripError}
+ {view === 'markdown' && hasAnyStripped ? (
+
+ {activePipelines.map(p => {
+ const { error, stripped } = stripByPipeline[p];
+ return (
+
+
{pipelineLabels[p]}
+ {error && (
+
+ stripComments error: {error}
+
+ )}
+ {stripped !== null ? (
+
{stripped}
+ ) : (
+ !error &&
No stripped output for this pipeline
+ )}
+
+ );
+ })}
- )}
- {view === 'markdown' && strippedMarkdown !== null ? (
-
{strippedMarkdown}
) : (view === 'mdast' || view === 'hast') && showAst ? (
{activePipelines.map(p => {
diff --git a/package.json b/package.json
index fa071476e..0b6fd595d 100644
--- a/package.json
+++ b/package.json
@@ -177,7 +177,7 @@
},
{
"path": "dist/main.node.js",
- "maxSize": "947KB"
+ "maxSize": "950KB"
}
]
},
diff --git a/processor/transform/mdxish/tables/mdxish-tables.ts b/processor/transform/mdxish/tables/mdxish-tables.ts
index 46e217ff7..45590179f 100644
--- a/processor/transform/mdxish/tables/mdxish-tables.ts
+++ b/processor/transform/mdxish/tables/mdxish-tables.ts
@@ -61,6 +61,15 @@ const buildTableNodeProcessor = (withMdx: boolean) =>
const tableNodeProcessor = buildTableNodeProcessor(true);
const fallbackTableNodeProcessor = buildTableNodeProcessor(false);
+const BLANK_LINE_REGEX = /(\r?\n)(?:[ \t]*\r?\n)+/g;
+
+/**
+ * Collapses any run of blank lines (empty or whitespace-only) to a single
+ * newline so the CommonMark type-6 block isn't terminated mid-table.
+ */
+export const collapseBlankLines = (value: string): string =>
+ value.replace(BLANK_LINE_REGEX, '$1');
+
/**
* Parse the HTML node that contains the full table substring
* into the table parts (headers, rows, cells).
@@ -355,8 +364,9 @@ const mdxishTables = (): Transform => tree => {
} else if (node.value.startsWith('
/g;
+// Indented whole-line comment plus trailing newline; removing the whole line
+// avoids leaving a whitespace-only line that terminates the surrounding block.
+const WHOLE_LINE_HTML_COMMENT_REGEX = /^[ \t]+[ \t]*(?:\r?\n|$)/gm;
export const MDX_COMMENT_REGEX = /\/\*(?:(?!\*\/)[\s\S])*\*\//g;
/**
@@ -14,7 +17,10 @@ export const stripCommentsTransformer = () => {
if (parent && typeof index === 'number') {
// Remove HTML comments
if (node.type === 'html' && HTML_COMMENT_REGEX.test(node.value)) {
- const newValue = node.value.replace(HTML_COMMENT_REGEX, '').trim();
+ const newValue = node.value
+ .replace(WHOLE_LINE_HTML_COMMENT_REGEX, '')
+ .replace(HTML_COMMENT_REGEX, '')
+ .trim();
if (newValue) {
node.value = newValue;
} else {