@podlite/markdown 0.0.59 → 0.0.60
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/lib/index.cjs +14 -14
- package/lib/index.cjs.map +2 -2
- package/lib/index.esm.js +5 -3
- package/lib/index.esm.js.map +1 -1
- package/package.json +2 -2
package/lib/index.esm.js
CHANGED
|
@@ -34042,6 +34042,7 @@ var plugin_tables_default = (opt = {}) => (tree) => {
|
|
|
34042
34042
|
report("table-source-unreadable", `no =data block found for data:${ref.target}, table rendered as empty`, node);
|
|
34043
34043
|
return { ...node, content: [] };
|
|
34044
34044
|
}
|
|
34045
|
+
const carryCover = (built) => config_default(dataBlock, {}).getFirstValue("masked") ? { ...built, guarded: true } : built;
|
|
34045
34046
|
const rawMime = config_default(dataBlock, {}).getFirstValue("mime-type");
|
|
34046
34047
|
const { type: mimeType, params: mimeParams } = parseMimeType(rawMime);
|
|
34047
34048
|
const isCsv = mimeType === "text/csv";
|
|
@@ -34056,10 +34057,10 @@ var plugin_tables_default = (opt = {}) => (tree) => {
|
|
|
34056
34057
|
const hasHeader = mimeParams.header === "present";
|
|
34057
34058
|
const allow = config_default(node, {}).getAllValues("allow");
|
|
34058
34059
|
const filledNode = { ...node, content: csvToTableContent(rows2, hasHeader, allow) };
|
|
34059
|
-
return normalizeCellCounts(filledNode, `table data:${ref.target}`, report);
|
|
34060
|
+
return carryCover(normalizeCellCounts(filledNode, `table data:${ref.target}`, report));
|
|
34060
34061
|
}
|
|
34061
34062
|
report("table-source-unreadable", `=data :key<${ref.target}> has non-tabular mime-type ${rawMime || "(none)"}, rendered as =code`, node);
|
|
34062
|
-
return buildCodeFromDataBlock(node, dataBlock);
|
|
34063
|
+
return carryCover(buildCodeFromDataBlock(node, dataBlock));
|
|
34063
34064
|
}
|
|
34064
34065
|
if (isStructured(node)) {
|
|
34065
34066
|
const attached = attachOrphanCells(node, report);
|
|
@@ -34151,7 +34152,8 @@ function resolveColumnIndex(col, headerRow, maxCols) {
|
|
|
34151
34152
|
}
|
|
34152
34153
|
const idx = headerRow.indexOf(col);
|
|
34153
34154
|
if (idx === -1) {
|
|
34154
|
-
|
|
34155
|
+
const names = headerRow.map((h) => `"${h}"`).join(", ");
|
|
34156
|
+
throw new Error(`column name "${col}" not found in header; header has ${names}`);
|
|
34155
34157
|
}
|
|
34156
34158
|
return idx;
|
|
34157
34159
|
}
|