ryancramerdesign / InputfieldTinyMCE

TinyMCE v6 for ProcessWire 3.0.200+
2 stars 2 forks source link

Invalid value passed for the invalid_styles option #7

Closed matjazpotocnik closed 2 years ago

matjazpotocnik commented 2 years ago

In dev tools, I see this warning: "Invalid value passed for the invalid_styles option". It's triggered by tinymce.init(config); at line 615 in InputfieldTinyMCE.js. Invalid Styles textarea in the module settings is empty. config.invalid_styles is an array rather than a string?

image

ryancramerdesign commented 2 years ago

@matjazpotocnik Thanks, I've pushed a fix. I think it's because your invalid_styles is empty and a blank PHP array translates to [] in JSON rather than {}. Since invalid_styles accept a blank string also, I've forced it to use a blank string (rather than blank array) for this case.

For your invalid_styles, I recommend that you enter the string "default" so that it uses the default invalid_styles value, unless you really want to allow all inline styles.