@markdoc/markdoc 0.5.3 → 0.5.5

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/index.mjs CHANGED
@@ -7199,7 +7199,7 @@ function* formatNode(n, o = {}) {
7199
7199
  if (o.parent && WRAPPING_TYPES.includes(o.parent.type)) {
7200
7200
  yield* escapeMarkdownCharacters(content, /[*_~]/g);
7201
7201
  } else {
7202
- yield* escapeMarkdownCharacters(content, /^\*|#+\s|>/);
7202
+ yield* escapeMarkdownCharacters(content, /^\*|#+\s|^>/);
7203
7203
  }
7204
7204
  }
7205
7205
  break;
@@ -7544,7 +7544,7 @@ function convertToRow(node2, cellType = "td") {
7544
7544
  cell.type = cellType;
7545
7545
  return node2;
7546
7546
  }
7547
- function transform(document2) {
7547
+ function transform(document2, conditionalTags = ["if"]) {
7548
7548
  for (const node2 of document2.walk()) {
7549
7549
  if (node2.type !== "tag" || node2.tag !== "table")
7550
7550
  continue;
@@ -7561,7 +7561,7 @@ function transform(document2) {
7561
7561
  for (const row of rest) {
7562
7562
  if (row.type === "list")
7563
7563
  convertToRow(row);
7564
- else if (row.type === "tag" && row.tag === "if") {
7564
+ else if (row.type === "tag" && row.tag && conditionalTags.includes(row.tag)) {
7565
7565
  const children = [];
7566
7566
  for (const child of row.children) {
7567
7567
  if (child.type === "hr")
@@ -7754,7 +7754,7 @@ function parser(tokens, args) {
7754
7754
  message: `Node '${node2.tag || node2.type}' is missing closing`
7755
7755
  });
7756
7756
  for (const transform3 of transforms_default)
7757
- transform3(doc);
7757
+ transform3(doc, args?.conditionalTags);
7758
7758
  return doc;
7759
7759
  }
7760
7760