Skip to content

Commit

Permalink
Merge pull request #1 from calmyournerves/fix-space-before-attr-delim…
Browse files Browse the repository at this point in the history
…iter

Fix space before attribute delimiter
  • Loading branch information
kolen authored Jul 3, 2024
2 parents 816fced + 497720c commit e5da461
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ module.exports = grammar({
),

[`_attrs_delimited_${suffix}`]: $ => seq(
optional($._space),
delim_open,
repeat(seq(
optional($._space_or_newline), alias($[`_attr_delimited_${suffix}`], $.attr)
Expand Down
19 changes: 19 additions & 0 deletions test/corpus/attributes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,25 @@ a[

-----

(source_file
(element
(tag_name)
(attrs
(attr
(attr_name)
(attr_assignment)
(attr_value)))))

===================================================================
String attributes - delimited multiline with space before delimiter
===================================================================

a {
href="/"
}

-----

(source_file
(element
(tag_name)
Expand Down

0 comments on commit e5da461

Please sign in to comment.