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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Liam Morland’s picture

Version: 7.x-1.6-rc2 » 7.x-1.x-dev
Status: Active » Needs review
FileSize
3.44 KB
2.02 KB

Two 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.

Liam Morland’s picture

Improved version of first patch. Second patch still OK.

geek-merlin’s picture

Issue summary: View changes
Status: Needs review » Postponed (maintainer needs more info)

Is there a good use case for this?

Liam Morland’s picture

Status: Postponed (maintainer needs more info) » Needs review

acronym 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.

The last submitted patch, 1: wysiwyg_filter_synonyms_1410832_indent.patch, failed testing. View results

geek-merlin’s picture

Hmm, i see. The patch seems to still apply. Did you test it thoroughly?

Liam Morland’s picture

It was 5 years ago, but that is what I normally do before posting a patch.

geek-merlin’s picture

Status: Needs review » Fixed
gisle’s picture

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

@[class],
em/i

You get the following warning:

Warning: Illegal string offset 'class' in wysiwyg_filter_parse_valid_elements() (line 271 of /var/www/html/sites/all/modules/wysiwyg_filter/wysiwyg_filter.inc).
Notice: Array to string conversion in wysiwyg_filter_parse_valid_elements() (line 271 of /var/www/html/sites/all/modules/wysiwyg_filter/wysiwyg_filter.inc).

Workaround: Do not define synonyms.

I.e.:

@[class],
em,i

"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).

geek-merlin’s picture

Status: Needs work » Fixed

Thanks @gisle! Handled in the other issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.