diff --git a/grammar.js b/grammar.js index b19ba95..f4bbaea 100644 --- a/grammar.js +++ b/grammar.js @@ -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) diff --git a/test/corpus/attributes.txt b/test/corpus/attributes.txt index 3110bb0..6db05a4 100644 --- a/test/corpus/attributes.txt +++ b/test/corpus/attributes.txt @@ -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)