Skip to content

Commit

Permalink
refactor: remove redundant matchers during paragraph matching
Browse files Browse the repository at this point in the history
  • Loading branch information
quantizor committed Jan 20, 2025
1 parent 7abb3b6 commit 6de5543
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/grumpy-kids-attack.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'markdown-to-jsx': patch
---

Remove redundant detectors when processing paragraphs.
4 changes: 1 addition & 3 deletions index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -560,18 +560,16 @@ const NON_PARAGRAPH_BLOCK_SYNTAXES = [
HEADING_R,
HEADING_SETEXT_R,
HEADING_ATX_COMPLIANT_R,
HTML_COMMENT_R,
NP_TABLE_R,
ORDERED_LIST_ITEM_R,
ORDERED_LIST_R,
UNORDERED_LIST_ITEM_R,
UNORDERED_LIST_R,
]

const BLOCK_SYNTAXES = [
...NON_PARAGRAPH_BLOCK_SYNTAXES,
PARAGRAPH_R,
HTML_BLOCK_ELEMENT_R,
HTML_COMMENT_R,
HTML_SELF_CLOSING_ELEMENT_R,
]

Expand Down

0 comments on commit 6de5543

Please sign in to comment.