Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix indented markdown in html #2052

Merged
merged 5 commits into from
May 20, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const block = {
+ '|<\\?[\\s\\S]*?(?:\\?>\\n*|$)' // (3)
+ '|<![A-Z][\\s\\S]*?(?:>\\n*|$)' // (4)
+ '|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)' // (5)
+ '|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)' // (6)
+ '|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n *\\n+|$)' // (6)
UziTech marked this conversation as resolved.
Show resolved Hide resolved
+ '|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)' // (7) open tag
+ '|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)' // (7) closing tag
krassowski marked this conversation as resolved.
Show resolved Hide resolved
+ ')',
Expand Down
4 changes: 4 additions & 0 deletions test/specs/new/indented_details.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<details>

<h2 id="heading">Heading</h2>
</details>
krassowski marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 4 additions & 0 deletions test/specs/new/indented_details.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<details>

## Heading
</details>
krassowski marked this conversation as resolved.
Show resolved Hide resolved