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 6bfa9ea commit 8801a68
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 8801a68

Please sign in to comment.