Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 2ab5984

Browse files
authored
Merge pull request #499 from code-hike/fix-values-with-break
Parse two values separated by a markdown break
2 parents 8540c25 + 360df6e commit 2ab5984

File tree

5 files changed

+20
-1
lines changed

5 files changed

+20
-1
lines changed

‎.changeset/afraid-lies-shave.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"codehike": patch
3+
---
4+
5+
Parse two values separated by a markdown break

‎packages/codehike/src/mdx/1.1.remark-list-to-section.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,8 @@ function isImageAndParagraphs(child: any): child is {
216216
return (
217217
(c.type === "image" && c.alt?.startsWith("!")) ||
218218
(c.type === "text" && c.value.trim().startsWith("!")) ||
219-
(c.type === "text" && c.value.trim() === "")
219+
(c.type === "text" && c.value.trim() === "") ||
220+
c.type === "break"
220221
)
221222
})
222223
}

‎packages/codehike/tests/md-suite/two-ps.0.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ cc
2525
ee ee
2626
ee
2727

28+
!k two-spaces-after-value
29+
!l because-some-use-prettier-proseWrap
30+
2831
## !invalid
2932

3033
ff ff

‎packages/codehike/tests/md-suite/two-ps.2.before-remark.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@
5656
"type": "paragraph",
5757
"children": [{ "type": "text", "value": "!e1 1\r\nee ee\r\nee" }]
5858
},
59+
{
60+
"type": "paragraph",
61+
"children": [
62+
{ "type": "text", "value": "!k two-spaces-after-value" },
63+
{ "type": "break" },
64+
{ "type": "text", "value": "!l because-some-use-prettier-proseWrap" }
65+
]
66+
},
5967
{
6068
"type": "heading",
6169
"depth": 2,

‎packages/codehike/tests/md-suite/two-ps.8.parsed-jsx.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ jjj
8686
"2",
8787
],
8888
"e1": "1\r\nee ee\r\nee",
89+
"k": "two-spaces-after-value",
90+
"l": "because-some-use-prettier-proseWrap",
8991
"title": "",
9092
},
9193
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /