Clone Error (strips necessary backslashes)
-
On our site running WordPress 5.8.1 we use blocks that may contain attributes with double dashes (i. e.
button--outline
). WordPress escapes these to\u002d\u002d
. Upon cloning a page containing these blocks with the latest plugin version 3.1.16 the generated/cloned markup is missing the\
in these attributes which in turn crash the complete editor with a JS error. Also refer to the example below:Original code, generated by the blocks save function:
<!-- wp:frutiger/colored-background {"backgroundClass":"u-background\u002d\u002dsecondary"} --> <div class="u-background--bleed u-background--secondary"><!-- wp:frutiger/two-columns {"layoutType":"5-2-5"} -->
Same code of the cloned post (retrieved from the database):
<!-- wp:frutiger/colored-background {"backgroundClass":"u-backgroundu002du002dsecondary"} --> <div class="u-background--bleed u-background--secondary"><!-- wp:frutiger/two-columns {"layoutType":"5-2-5"} -->
I have not observed this erronous behaviour in older core versions and have found this possibly related core ticket.
- The topic ‘Clone Error (strips necessary backslashes)’ is closed to new replies.