@patternfly/quickstarts 5.4.2 → 5.4.3

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.es.js CHANGED
@@ -1303,8 +1303,15 @@ const markdownConvert = (markdown, extensions) => __awaiter(void 0, void 0, void
1303
1303
  node.setAttribute('xlink:show', 'new');
1304
1304
  }
1305
1305
  });
1306
- // Replace code fences with non markdown formatting relates tokens so that marked doesn't try to parse them as code spans
1307
- const markdownWithSubstitutedCodeFences = markdown.replace(/```/g, '@@@');
1306
+ const reverseString = (str) => str.split('').reverse().join('');
1307
+ // replace code fences that end in a double curly brace (which are used by our custom md extensions) with non
1308
+ // markdown formatting related tokens so that marked doesn't try to parse them as code spans
1309
+ //
1310
+ // we want to reverse the string before we do the substitution so that we only match the opening code fence which
1311
+ // corresponds to the closing code fence with the double curly brace
1312
+ const reversedMarkdown = reverseString(markdown);
1313
+ const reverseMarkdownWithSubstitutedCodeFences = reversedMarkdown.replace(/{{```((.|\n)*?)```/g, '{{@@@$1@@@');
1314
+ const markdownWithSubstitutedCodeFences = reverseString(reverseMarkdownWithSubstitutedCodeFences);
1308
1315
  const parsedMarkdown = yield marked.parse(markdownWithSubstitutedCodeFences);
1309
1316
  // Swap the temporary tokens back to code fences before we run the extensions
1310
1317
  let md = parsedMarkdown.replace(/@@@/g, '```');