Skip to content

Commit

Permalink
fix text enclosed in square brackets
Browse files Browse the repository at this point in the history
  • Loading branch information
msvechla authored and qvalentin committed Dec 3, 2023
1 parent 8f7c762 commit 4ecfc7e
Show file tree
Hide file tree
Showing 4 changed files with 3,432 additions and 3,219 deletions.
3 changes: 3 additions & 0 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ module.exports = grammar({

text: $ =>
choice(
// identify text enclosed in square brackets as coherent text
/\[[^\n]+\]/,
// identify text enclosed in quotes as coherent text
/"[^{\n]+"/,
/'[^{\n]+'/,
token(
Expand Down
4 changes: 4 additions & 0 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
"text": {
"type": "CHOICE",
"members": [
{
"type": "PATTERN",
"value": "\\[[^\\n]+\\]"
},
{
"type": "PATTERN",
"value": "\"[^{\\n]+\""
Expand Down
Loading

0 comments on commit 4ecfc7e

Please sign in to comment.