coblocks icon indicating copy to clipboard operation
coblocks copied to clipboard

ISBAT compare 'slug-like' strings across languages in Form block

Open AnthonyLedesma opened this issue 6 years ago • 0 comments

Describe the bug The From block has the ability to use Dynamic Subject lines by using shortcode replacements in the subject. The Form block currently does not process the shortcode into a 'slug-like' string yet it should both for programmatic comparison as well as visual placeholders. This fix will prevent undesirable aesthetics across international languages, namely those which use special characters.

Visual display of shortcode placeholders should be slug-like across languages. https://github.com/godaddy-wordpress/coblocks/blob/0f75724b1f1a7f5d7772b2c53997601efb25b8a1/src/blocks/form/edit.js#L293-L305

Programmatic comparison of shortcode slugs https://github.com/godaddy-wordpress/coblocks/blob/0f75724b1f1a7f5d7772b2c53997601efb25b8a1/includes/class-coblocks-form.php#L928-L958

Possible technology to use: Lodash Kebab case https://lodash.com/docs/4.17.15#kebabCase

AnthonyLedesma avatar Jan 14 '20 16:01 AnthonyLedesma