@patternfly/quickstarts 2.4.4 → 2.4.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.es.js CHANGED
@@ -1314,8 +1314,18 @@ const markdownConvert = (markdown, extensions) => __awaiter(void 0, void 0, void
1314
1314
  node.setAttribute('xlink:show', 'new');
1315
1315
  }
1316
1316
  });
1317
- // Replace code fences with non markdown formatting relates tokens so that marked doesn't try to parse them as code spans
1318
- const markdownWithSubstitutedCodeFences = markdown.replace(/```/g, '@@@');
1317
+ const reverseString = (str) => str
1318
+ .split('')
1319
+ .reverse()
1320
+ .join('');
1321
+ // replace code fences that end in a double curly brace (which are used by our custom md extensions) with non
1322
+ // markdown formatting related tokens so that marked doesn't try to parse them as code spans
1323
+ //
1324
+ // we want to reverse the string before we do the substitution so that we only match the opening code fence which
1325
+ // corresponds to the closing code fence with the double curly brace
1326
+ const reversedMarkdown = reverseString(markdown);
1327
+ const reverseMarkdownWithSubstitutedCodeFences = reversedMarkdown.replace(/{{```((.|\n)*?)```/g, '{{@@@$1@@@');
1328
+ const markdownWithSubstitutedCodeFences = reverseString(reverseMarkdownWithSubstitutedCodeFences);
1319
1329
  const parsedMarkdown = yield marked.parse(markdownWithSubstitutedCodeFences);
1320
1330
  // Swap the temporary tokens back to code fences before we run the extensions
1321
1331
  let md = parsedMarkdown.replace(/@@@/g, '```');