liip / bootstrap-blocks-wordpress-plugin

Bootstrap Gutenberg Blocks for WordPress

Home Page:https://wordpress.org/plugins/wp-bootstrap-blocks/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Strange className encoding

forcecodema opened this issue · comments

Hi,

Double minus sign in className property is encoded in the following way:

<!-- wp:wp-bootstrap-blocks/column {"className":"offer-deep\u002d\u002dimg_wrapper"} -->

className entered in editor is offer-deep--img_wrapper

Regards,

Michal

Hmm we're actually using the official className attribute of Gutenberg. But I will look into that.

This looks like the default behavior of the editor. It also happens with core blocks. I tried it with the core/paragraph block:

<!-- wp:paragraph {"className":"test\u002d\u002dclass test-class"} -->

It seems that a double dash gets encoded with unicode characters when saved in the className attribute. But the output on the page seems to be correct again:

<p class="test--class test-class">

So this encoding is not mandatory to keep when persisting the code in a block pattern file.