@changerawr/markdown 1.1.6 → 1.1.7

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
@@ -1,5 +1,5 @@
1
1
  // src/parser.ts
2
- var MarkdownParser = class {
2
+ var MarkdownParser = class _MarkdownParser {
3
3
  // Cache compiled regexes
4
4
  constructor(config) {
5
5
  this.rules = [];
@@ -212,7 +212,18 @@ var MarkdownParser = class {
212
212
  recursivelyParseBlockContent(token) {
213
213
  const blockTypes = ["alert", "blockquote", "list-item", "task-item"];
214
214
  if (blockTypes.includes(token.type) && token.content && token.content.trim()) {
215
- const children = this.parse(token.content);
215
+ let children;
216
+ if ((token.type === "list-item" || token.type === "task-item") && this.rules.some((r) => r.name === "list-item")) {
217
+ const parserWithoutListRule = new _MarkdownParser(this.config);
218
+ this.rules.forEach((rule) => {
219
+ if (rule.name !== "list-item" && rule.name !== "task-item") {
220
+ parserWithoutListRule.addRule(rule);
221
+ }
222
+ });
223
+ children = parserWithoutListRule.parse(token.content);
224
+ } else {
225
+ children = this.parse(token.content);
226
+ }
216
227
  return {
217
228
  ...token,
218
229
  children