if-condition treats `]` as a closing bracket
Created originally on Bitbucket by Antonymity
Using version 2.0.11 on Windows (twine_2.0.11_win64)
My use case here is adding and subtracting stat points:
hp: 1 [+]
Clicking the + will increase $hp by 1. If $hp > 1 then we want to show a - sign
hp: 2 [+][-]
so you can lower the value.
My code is:
#!javascript
hp: $hp `[`[[+|+hp]]`]`(if: $hp > 1)[`[`[[-|-hp]]`]`]
Unfortunately, the program treats that
#!javascript
`]`
near the end as the closing bracket, even thought I put it within `` to instruct it to display the character instead, and have the last ] on the line as the closing bracket.
What this ends up doing is making my output look like this:
When $hp is 1:
hp: 1 [+]`]
When $hp > 1: