"Correct faulty and chopped off HTML" filter breaks JSON with

Created on 11 July 2023, about 1 year ago
Updated 12 July 2023, about 1 year ago

Problem/Motivation

For a block containing Shopify Buy Buttons (JavaScript) with only "Correct faulty and chopped off HTML" filter enabled (and limited to administrators) the filter removed the closing HTML elements from the JSON code:

[...]
"templates": {
  "title": `<div class="h3">Title {{data.title}}</div>`,
  "price": `<div class="h2">Hello world {{data.selectedVariant.price}}</div>`,
},
[...]

was filtered into:

[...]
"templates": {
  "title": `<div class="h3">Title {{data.title}}`,
  "price": `<div class="h2">Hello world {{data.selectedVariant.price}}`,
},
[...]

https://github.com/Shopify/buy-button-js/issues/806

The expected and correct result would be to keep the closing brackets from the JavaScript. Removing them breaks the code here.
Not sure if this edge-case is relevant, but I thought it would make sense to let you know. Especially because the reason isn't simple to find.

This might be an upstream issue with the library used to clean the HTML?

Steps to reproduce

See above.

Proposed resolution

Do not correct HTML within JSON or code withing

tags at all?

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Active

Version

11.0 πŸ”₯

Component
FilterΒ  β†’

Last updated 2 days ago

No maintainer
Created by

πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024