samengine 1.7.5 → 1.7.6
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/dist/build/index.js +1 -1
- package/dist/utils/markdown.js +3 -3
- package/package.json +1 -1
package/dist/build/index.js
CHANGED
package/dist/utils/markdown.js
CHANGED
|
@@ -193,10 +193,10 @@ function parseTable(block, opts) {
|
|
|
193
193
|
if (rows.length < 2)
|
|
194
194
|
return `<p>${renderInline(block, opts)}</p>`;
|
|
195
195
|
const headerCells = rows[0]
|
|
196
|
-
.split(
|
|
196
|
+
.split(/(?<!\\)\|/)
|
|
197
197
|
.filter((_, i, a) => !(i === 0 && _ === "") && !(i === a.length - 1 && _ === ""))
|
|
198
198
|
.map((c) => c.trim());
|
|
199
|
-
const alignRow = rows[1].split(
|
|
199
|
+
const alignRow = rows[1].split(/(?<!\\)\|/).filter((c) => /[-:]/.test(c));
|
|
200
200
|
const aligns = alignRow.map((c) => {
|
|
201
201
|
c = c.trim();
|
|
202
202
|
if (c.startsWith(":") && c.endsWith(":"))
|
|
@@ -215,7 +215,7 @@ function parseTable(block, opts) {
|
|
|
215
215
|
.join("\n")}\n</tr>\n</thead>`;
|
|
216
216
|
const bodyRows = rows.slice(2).map((row) => {
|
|
217
217
|
const cells = row
|
|
218
|
-
.split(
|
|
218
|
+
.split(/(?<!\\)\|/)
|
|
219
219
|
.filter((_, i, a) => !(i === 0 && _ === "") && !(i === a.length - 1 && _ === ""))
|
|
220
220
|
.map((c) => c.trim());
|
|
221
221
|
return `<tr>\n${cells
|