JSON parse error with custom block
-
Hi,
I have a custom block, that stores a JSON string in one of the attributes. When duplicating the post, the escaped qoutes get replaced by simple quotes, which breaks the json parse function.
Code from the database (original post) like this:
alt=\"\"
Gets duplicated (duplicate from database), like this:
alt=""
Causing the JSON.parse error on the frontend edit page.
Which means the copy is not exact.
Would be great, if you could address this.To replicate the error, create a block, that stores a stringified JSON string in a DOM element dataset attribute, like for example data-card-content, and renders the content using the JSON.parse function in JS with map.
Save the post with the block.
Duplicate with plugin.
Attempt to edit the duplicated post
JSON.parse error within a value
- The topic ‘JSON parse error with custom block’ is closed to new replies.