cyrusfirheir / twee3-language-tools

[ VSCode extension ] Syntax highlighting and programmatic language tools for Twee 3, and Twine 2 storyformats.
https://marketplace.visualstudio.com/items?itemName=cyrusfirheir.twee3-language-tools
MIT License
47 stars 15 forks source link

Syntax highlighting issue with Twee link markup inside SugarCube macro #131

Closed spikymoth closed 1 year ago

spikymoth commented 1 year ago

I'm working on a SugarCube2-based project with a macro for conversation choices that takes passage links as its arguments:

    ConversationChoices:
      name: ConversationChoices
      parameters:
        - "link |+ ...link"

Unfortunately using it with a newline before the first argument seems to break this extension's syntax highlighting:

image

Here's the test file as text:

:: Test convo
[[Outside macro 0|Choice0]]
[[Outside macro 1|Choice1]]
[[Outside macro 2|Choice2]]

<<ConversationChoices [[Inside macro no newline 0|Choice0]]
    [[Inside macro no newline 1|Choice1]]
    [[Inside macro no newline 2|Choice2]]
>>

<<ConversationChoices
    [[Inside macro w/ newline 0|Choice0]]
    [[Inside macro w/ newline 1|Choice1]]
    [[Inside macro w/ newline 2|Choice2]]
>>

<<ConversationChoices [[Inside macro no newline with ' 0|Choice0]]
    [[Inside macro no newline with ' 1|Choice1]]
    [[Inside macro no newline with ' 2|Choice2]]
>>

<<ConversationChoices
    [[Inside macro w/ newline with ' 0|Choice0]]
    [[Inside macro w/ newline with ' 1|Choice1]]
    [[Inside macro w/ newline with ' 2|Choice2]]
>>

:: Choice0

:: Choice1

:: Choice2

In the actual project, the syntax highlighting gets more and more broken after a few instances of using the macro with a link description that contains an apostrophe.

Could you take a look?

cyrusfirheir commented 1 year ago

Update to v0.19.10. Should be fixed.

spikymoth commented 1 year ago

Confirmed, thanks for the quick fix!