Skip to content

Commit 653d7b2

Browse files
committed
add leading and trailing whitespace to text nodes
1 parent 0393001 commit 653d7b2

File tree

4 files changed

+730
-692
lines changed

4 files changed

+730
-692
lines changed

grammar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,6 @@ module.exports = grammar({
138138
seq('"', optional(alias(/[^"]+/, $.attribute_value)), '"'),
139139
),
140140

141-
text: _ => /[^<>&\s]([^<>&]*[^<>&\s])?/,
141+
text: _ => /[^<>&]+/,
142142
},
143143
});

src/grammar.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@
442442
},
443443
"text": {
444444
"type": "PATTERN",
445-
"value": "[^<>&\\s]([^<>&]*[^<>&\\s])?"
445+
"value": "[^<>&]+"
446446
}
447447
},
448448
"extras": [

0 commit comments

Comments
 (0)