Skip to content

Commit

Permalink
Allows space before the attr delimiter
Browse files Browse the repository at this point in the history
  • Loading branch information
calmyournerves committed Jul 3, 2024
1 parent 816fced commit 615b931
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 variant
===============================================

a {
href="/"
}

-----

(source_file
(element
(tag_name)
Expand Down

0 comments on commit 615b931

Please sign in to comment.