Skip to content

Commit f9b5f72

Browse files
fix(message-parser): replace Inline loops with scalar matcher to prevent newline absorptions
1 parent 329c2d3 commit f9b5f72

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/message-parser/src/grammar.pegjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,11 @@ CodeChunk = text:$(!EndOfLine !"```" .)+ { return plain(text); }
144144
* #### Heading 4
145145
*
146146
*/
147-
Heading = count:HeadingStart [ \t]+ text:HeadingChunk { return heading(text.map(v => Array.isArray(v) ? v[1] : v), count); }
147+
Heading = count:HeadingStart [ \t]+ text:HeadingChunk { return heading(text, count); }
148148

149149
HeadingStart = value:"#" |1..4| { return value.length; }
150150

151-
HeadingChunk = text:(!EndOfLine Inline)+ { return text; }
151+
HeadingChunk = text:Inline { return text; }
152152

153153

154154
/**

0 commit comments

Comments
 (0)