Skip to content

Commit 7a01cbc

Browse files
committed
amend
1 parent 171cc18 commit 7a01cbc

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

obsidian.js

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -478,19 +478,18 @@ function postprocessFragments(html) {
478478
// Block fragments
479479
html = html.replace(
480480
new RegExp(`${fragment_start.string}([\\s\\S]*?)${fragment_end.string}([\\s\\S]*?</li>)`, 'g'),
481-
(fullMatch, content, trailingLi) => {
482-
let fixed = (content + trailingLi).trim();
481+
(fullMatch, content, trailingLi) => {
482+
let fixed = (content + trailingLi).trim();
483483

484-
// Remove <p> inside <li>
485-
fixed = fixed.replace(
486-
/<li>\s*\n?\s*<p>([\s\S]*?)<\/p>\s*\n?\s*<\/li>/gm,
487-
(_, inner) => `<li>${inner.trim()}</li>`
488-
);
489-
490-
return `<div class="fragment">\n${fixed}\n</div>\n\n`;
491-
}
492-
);
484+
// Remove <p> inside <li>
485+
fixed = fixed.replace(
486+
/<li>\s*\n?\s*<p>([\s\S]*?)<\/p>\s*\n?\s*<\/li>/gm,
487+
(_, inner) => `<li>${inner.trim()}</li>`
488+
);
493489

490+
return `<div class="fragment">\n${fixed}\n</div>\n\n`;
491+
}
492+
);
494493

495494
// Inline fragment: list item
496495
html = html.replace(

0 commit comments

Comments
 (0)