Skip to content

theme-check(ValidJSON) mistakenly highlights plural with html as error #798

Open
@frej-hobbii

Description

Describe the bug
When adding a locale that has html content inside, the theme check highlights it as an error, even though it works as expected in liquid.

When combining _html postfix to render the locale string as HTML, and a plural, the linting gets confused.

locale

  "ticker": {
    "ticker_physical_stores_html": {
      "one": "<strong>{{ count }} huge</strong> store",
      "other": "<strong>{{ count }} huge</strong> stores"
    }
  },

liquid

<div>{{ 'ticker.ticker_physical_stores_html' | t: count: 3 }}</div>
Screenshot 2024-05-14 at 10 30 22 Screenshot 2024-05-14 at 10 30 40

The CLI theme check works as expected, resulting in no errors

Screenshot 2024-05-14 at 10 45 21

Expected behaviour
The VS code extension's theme check should work the same as the CLI

Actual behaviour
False negative is thrown

Debugging information

  • OS: Mac
  • OS Version: Sonoma 14.1.1
  • Theme Check Version shopify.theme-check-vscode Shopify Liquid v2.3.2

Additional context
Add any other context about the problem here.

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions