Skip to content

Commit f6c9174

Browse files
committed
fix singular empty lines captured as raw body
1 parent 827efb3 commit f6c9174

File tree

5 files changed

+6016
-5293
lines changed

5 files changed

+6016
-5293
lines changed

grammar.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ module.exports = grammar({
1111
extras: (_) => [],
1212
conflicts: ($) => [
1313
[$.target_url],
14+
[$.raw_body],
1415
[$._raw_body],
1516
[$._section_content],
1617
],
@@ -276,7 +277,14 @@ module.exports = grammar({
276277
),
277278
)),
278279

279-
raw_body: ($) => $._raw_body,
280+
raw_body: ($) =>
281+
seq(
282+
choice(
283+
token(prec(1, seq(/.+/, NL))),
284+
seq($._comment_prefix, $._not_comment),
285+
),
286+
optional($._raw_body),
287+
),
280288
_raw_body: ($) =>
281289
seq(
282290
choice(

src/grammar.json

Lines changed: 76 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)