Skip to content

Commit

Permalink
add leading and trailing whitespace to text nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
milahu committed Mar 5, 2024
1 parent 0393001 commit 653d7b2
Show file tree
Hide file tree
Showing 4 changed files with 730 additions and 692 deletions.
2 changes: 1 addition & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,6 @@ module.exports = grammar({
seq('"', optional(alias(/[^"]+/, $.attribute_value)), '"'),
),

text: _ => /[^<>&\s]([^<>&]*[^<>&\s])?/,
text: _ => /[^<>&]+/,
},
});
2 changes: 1 addition & 1 deletion src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@
},
"text": {
"type": "PATTERN",
"value": "[^<>&\\s]([^<>&]*[^<>&\\s])?"
"value": "[^<>&]+"
}
},
"extras": [
Expand Down
Loading

0 comments on commit 653d7b2

Please sign in to comment.