Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markup syntax displayed as raw strings in the VS Code preview tab and try.yarnspinner #6

Open
maetl opened this issue Nov 28, 2022 · 2 comments

Comments

@maetl
Copy link

maetl commented Nov 28, 2022

Markup syntax (such as the plural and ordinal tags) embedded in dialogue lines is passing through as raw strings to the preview UI.

Steps to reproduce

Write a script in VS Code editor or web editor that incorporates markup tags.

User-defined tags

title: Start
---
Oh, [wave]hello[/wave] there!
I'm [wave/] waving at you!
Are you [bump]paying[/bump] attention?
===

Text replacement markers

title: Start
---
<<if not visited("Start")>>
    <<set $gold to 0>>
<<endif>>

You have [plural value={$gold} one="% doubloon" other="% doubloons"]

-> Accumulate Gold
   <<set $gold += 1>>
   <<jump Start>>
===

Play the dialogue preview and step through each line.

Expected Behaviour

This is actually somewhat ambiguous and it’s not 100% clear to me what should happen here. According to the version 2 docs:

When text is parsed, the tags are removed from the text

So it’s possible to interpret the expected behaviour here as either:

  • The plain text line gets passed through without tags
  • The tags are extracted/rewritten and displayed in the UI

Actual Behaviour

The markup is passed through to the preview line in its raw unparsed form, as-written.

image

image

@McJones
Copy link

McJones commented Nov 29, 2022

So personally I think the way we should resolve this is two fold, first we should parse the markup and remove it from the line as shown and have some sort of expanded section on the line saying "hey the markup we extracted was X".

I don't think we should add in support for any markup, localisation markup included because at this stage try is intended to quickly explore Yarn, not for being a standalone game making tool.

Because try gives no way to define markup specific behaviour we should just say "hey there is markup here" and because we don't have any means of localising lines creating and maintaining TS specific formatters feels like extra work that won't be paid off.

Thoughts?

@maetl
Copy link
Author

maetl commented Dec 14, 2022

That rationale makes sense. Having this shared as an embedded previewer in VS Code might potentially skew people’s expectations slightly more towards being an integrated tool than the first impressions/quick exploration on the web.

The main issue I see here is actually in how the docs contextualise this markup, as someone doing a quick exploration is also quite likely to be quickly skim-reading the docs. Recognising the markup in the preview—even if nothing is done with it—at least enables people to copy/paste and edit examples straight from the docs and see how to compose markup and localisation stuff in their source text.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants