Skip to content

Commit

Permalink
handled escaping characters at the start of lines.
Browse files Browse the repository at this point in the history
Because of the quirks of markup it meant that it was losing the escaped character and that was causing all sorts of issues when it occurs at the start of a line.
Added a new specific rule before escaping occurs to catch this, not the best approach but it works for now.
Fixes #377
  • Loading branch information
McJones committed Nov 7, 2023
1 parent 5805c17 commit a8ffc87
Show file tree
Hide file tree
Showing 4 changed files with 700 additions and 679 deletions.
7 changes: 6 additions & 1 deletion Tests/TestCases/Escaping.testplan
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,9 @@ option: Here's a url: http://github.com/YarnSpinnerTool
option: Here's some markup: hello
option: Here's some escaped markup: [a]hello[/a]

select: 1
select: 1

line: <<escaped command>>
line: {0} escaped line with interpolation
line: // escaped comment
line: [a]escaped markup[/a]
7 changes: 5 additions & 2 deletions Tests/TestCases/Escaping.yarn
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ Here's some escaped markup: \[a\]hello\[/a\]
-> Here's some markup: [a]hello[/a]
-> Here's some escaped markup: \[a\]hello\[/a\]

// Commented out because this isn't actually allowed, but we're just
// maintaining the pattern here:
// testing the various escaped elements also work at the start of a statement:
\<\<escaped command\>\>
\{0\} escaped line with interpolation
\/\/ escaped comment
\[a]escaped markup\[/a]

===
Loading

0 comments on commit a8ffc87

Please sign in to comment.