Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Depending on how one interprets "using the same syntax of the TinyMCE valid_elements option", this may actually be a feature request.
The TinyMCE valid_elements documentation states for the "/" character: "Separates element synonymous. The first element is the one that will be output."
I take this to mean if you have a definition like "abbr/acronym", both elements are allowed, but when the page is actually rendered, both elements render using the first element. What is happening instead is that both elements are allowed, and are rendering as themselves.
Comment | File | Size | Author |
---|---|---|---|
#2 | wysiwyg_filter_synonyms_1410832.patch | 2.07 KB | Liam Morland |
#1 | wysiwyg_filter_synonyms_1410832.patch | 2.02 KB | Liam Morland |
#1 | wysiwyg_filter_synonyms_1410832_indent.patch | 3.44 KB | Liam Morland |
Comments
Comment #1
Liam MorlandTwo patches attached. The first fixes this issue. The second corrects indentation to match the changes in the first patch. I have them separate to make it easier to see what has changed functionally. Apply the patches in order.
Comment #2
Liam MorlandImproved version of first patch. Second patch still OK.
Comment #3
geek-merlinIs there a good use case for this?
Comment #4
Liam Morlandacronym is obsolete; people should be using abbr. This ensures that this will happen.
As the second paragraph in the description mentions, this change is lining up behavior with documentation.
Comment #6
geek-merlinHmm, i see. The patch seems to still apply. Did you test it thoroughly?
Comment #7
Liam MorlandIt was 5 years ago, but that is what I normally do before posting a patch.
Comment #9
geek-merlinComment #10
gisleSetting this back to "Needs work".
In HTML elements and attributes , if you whitelist one or more common attributes along with at least one synonymous element. E.g:
You get the following warning:
Workaround: Do not define synonyms.
I.e.:
"fixes" it.
(I believe is #2916971: Warning: Illegal string offset 'class' in function wysiwyg_filter_parse_valid_elements() (line 271 in file .../sites/all/modules/wysiwyg_filter/wysiwyg_filter.inc) is a duplicate).
Comment #11
geek-merlinThanks @gisle! Handled in the other issue.