@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.js +13 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -2
- package/dist/index.mjs.map +1 -1
- package/dist/react/index.js +13 -2
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +13 -2
- package/dist/react/index.mjs.map +1 -1
- package/dist/standalone.browser.js +13 -2
- package/dist/standalone.js +13 -2
- package/dist/standalone.js.map +1 -1
- package/dist/standalone.mjs +13 -2
- package/dist/standalone.mjs.map +1 -1
- package/package.json +1 -1
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
|
-
|
|
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
|