tinymce-docs icon indicating copy to clipboard operation
tinymce-docs copied to clipboard

"valid_elements" syntax for element removal when empty attributes needs example

Open blindspeed90 opened this issue 1 year ago • 2 comments

Documentation/Product Version 6.8.5

Links to Page(s) affected https://www.tiny.cloud/docs/tinymce/latest/content-filtering/#valid_elements

Description of Issue

This entry:

"! - Enables removal of elements with no attributes such as . They can still have content though."

needs example, as I had to look into the code to find the "elementRuleRegExp" in tinymce.js and break it apart to figure out its' usage. Here, it needs to be something like "-span![!style]", the "!" in front of "[", whereas "!style" means a required attribute.

Suggested Fix Adding the example with that comment would help.

Also, breaking this table up or adding a column to show what control characters can go where. Better than that, from that RegExp, having a template documented like BNF is far clearer (brief and incomplete, but you get the point):

=[","] =["/"][]["[""]"] = "+" | "-" | "#" = "@" | "*" | = = ="" | "!"

blindspeed90 avatar Jan 23 '25 15:01 blindspeed90

The editor removed all my BNF tags I had as an example above.

blindspeed90 avatar Jan 23 '25 15:01 blindspeed90

@blindspeed90 thanks for this - spent many hours trying to figure this out, documentation needs to be updated

cMack87 avatar Aug 09 '25 18:08 cMack87