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

Open
#3,588 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
Half a day
Newbie friendliness
45/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript
Domain
documentation

Research direction

Start with the content-filtering documentation page at the linked valid_elements section and compare its current table with the syntax described in the issue. Document an example such as -span![!style] and clarify the control-character placement; consider the proposed grammar only if it fits the page. Done means the empty-element and required-attribute syntax can be understood without reading tinymce.js.

Written by the indexing model from the issue text.

Description

bug

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):

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

Dominant language
JavaScript
Stars
96
Forks
219
Avg merge
1d 4h
Merged PRs (30d)
26

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from tinymce/tinymce-docs

All issues in tinymce/tinymce-docs

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.