List of TinyMCE defects in Plone 5.2 / call for fixing issues and participation

Here is a list of things that is broken or not working in TinyMCE shipped with Plone 5.2:

Tables

  • BUG: a table can be visually resized but the width is always reset to 100%
  • BUG: cell width and height can be visually changed but width/height are always reset to their default
  • BUG: "Table properties" basically dysfunctional (e.g. setting a border has no effect)

Formatting options

  • USABILITY: 4 fours way to set text to bold/italic: toolbar, formats dropdown in toolbar, format menu, format -> formats-> inline menu
  • BUG: almost all styles from format dropdown/menu are not persisted
  • BUG: left|right|center|justify from toolbar visually working but not saved
  • BUG: indent|outdent from toolbar visually working but not saved

Others

  • "Visual aids" not working
  • BUG: inserting "horizontal line" not working
  • insert media: you can not change the size of an inserted video other through editing the HTML source code

The issues affect the most basic functionality of TinyMCE. Obvious bugs and misbehavior that affects every content editor working with Plone. The current situation is a disgrace for any content editor (not mentioning (again) that we advertise Plone as "enterprise CMS" but ship it completely messy editor).

There is an urgent need for everyone for having the issues (marked as BUG) fixed in Plone 5.2 asap.
There is certainly a budget for fixing things in one of our current customer projects and there is perhaps some budget in your customer project.

I would like coordinate the work to be done here and asking for

  • a dev that has the knowledge and insight for fixing the issues marked as BUG
  • financial support from other Plone solution providers for getting TinyMCE fixed for our your and our customers and all Plone users
1 Like

Disable the HTML Filter and some "bugs" go away.

Workarounds are not the solution for broken functionality.

1 Like

the best is adding tests that return errors. Developers hates red blinking around and will try to fix it.

But html formatting is quite impossible to reproduce, maybe robot tests can do it. Some test can just work adding html content to the field and saving it and doing a test checking what should not be filtered out.

Great initiative! We should add the task to update to TinyMCE 5.x.

I have posted some details on formatting issues but actually fixing them might be tricky.

One class of format issues is that they assign a "style" attribute which is stripped by TinyMCE by default. Reported with a proposal here https://github.com/plone/Products.CMFPlone/issues/3069. Plone is getting its list of good attributes from lxml.html.defs.safe_attrs + custom assigned attributes. "style" is not in that def. Is there a way to get it to do this by applying a tag/class or do we need to allow the style attribute?

Nice to have: there are several 3rd party options for styling tables such as the Datatables jQuery plugin. A lot of these rely on having <thead> and <th> tags. It is currently a huge PITA to change these through properties - you have to set the property on the row and on each cell. This might be a TinyMCE limitation but would be nice if you could set this on the table level.

where does that happen?

Would it work to enable style by default and instead add it to 'bad tags' in TinyMCE control panel?

Or better: Just remove 'bad combinations (content of 'style')


Unrelated, but 'ages ago' I made an add-on that was never used (because I did not get the job I planned if for)

I used lxml to filter content and had a control panel for what to filter ( https://youtu.be/jE1gLOBBKb4?t=29 ).

Would that be better / possible with TinyMCE too ?

I think it is wrong to strip tags, better to give a good user experience and implement browser standards for security, instead of implementing stripping of style you can add on dom with javascript... quite useless!

To answer, if you need style, use the jquery .css() on the tag to set it.

Bear with me if I remember wrong, but the idea was to do all the filtering one place, with https://lxml.de/api/lxml.html.clean.Cleaner-class.html

Having all these things not working is just 'crazy'.

It looks like a lot of the bugs are because of 'style' being stripped.
Disabling filtering is a bad idea (someone will paste some javascript).

I did the following:

  1. Remove style from 'dangerous codes'
  2. Add it 'in the other two' (see screenshot)
  3. Disable html filtering
  4. Save
  5. Revert 'disable filtering'
  6. Save

Style now seems to 'work', … for now.

If it should be of any interest… these are what it is like (now)

1 Like

This is how strikethrough and indent/outdent work. Possibly others, but I've only investigated these. I don't follow your subsequent questions.

There is is pull request on mockup from march 2019 to upgrade to TinyMCE 5.0.1 which seems not that invasive/large. Biggest issue wille be compatibility testing.

But the currently used TinyMCE 4.x hasn't been updated in mockup for a while either, we are using 4.7.13 from the https://github.com/artursmirnov/tinymce_builded repo, where tinymce itself is now at 4.9.10. @frapell and @erral have been doing most of the effort by updating the builded versions of tinymce in that repo.

I do realise a lot of the issues above are around html filtering, which updating TinyMCE itself might not solve. But it could save us from hunting down other obscure TinyMCE issues that have been fixed upstream if we stick closer to their releases/updates.

Disable html filtering
Save
Revert 'disable filtering'
Save

I remember having similar issues where the html filtering worked half ass-ed and this kind of trick worked. @mauritsvanrees looked at it and solved part of the issue, but I cannot find back the issue/ticket on github. :frowning:

Some time ago I updated TinyMCE in the tinymce_bundled repository to have the latests translation files, but I haven't done more on that.

I think that Plone was using the tinymce_bundled because back then it was available for bower and then we just kept using it. Some time ago the author said that he was away from tinymce (see https://github.com/artursmirnov/tinymce_builded/pull/17#issuecomment-421381318) and then I think that only @frapell has made some more improvements.

Perhaps it's the time to go away from that tinymce package and go to the official tinymce package in npm? https://www.npmjs.com/package/tinymce

All 'those' are related to 'style'.
Justify left, right, center
Width of table
Color of text (etc) if you enable that.

horizontal line is a separate tag which can be enabled (not sure if it is hr or hr/ , but adding it 'works'.

Maybe even more confusing (?) is that you can set some properties for table from the format menu

Those serve different purposes. The formats pullout is the set of table classes you can define in the control panel. It makes sense to me to have these Headers/Block/Tables/etc sections grouped together for defining the class(es) that these belong to. The table dropdown is properties specific to a table.

I am still in favor of @zopyx's point though. You can configure the entire toolbar in Plone already and my company does this to be less noisy, but it would be good to clean up a bit for Plone core.

Besides the usability discussion: all the BUG's menitoned by @zopyx above are gone if you

  1. go to /@@filter-controlpanel
  2. add hr to "allowed tags"
  3. add style to "custom attributes"

I've just tried this on demo.plone.org/de and it just works.
So why not simply do this per default in Products.CMPlone.interfaces.controlpanel.IFilterSchema ?

Sometimes solutions can be simple...

+1

PR's are done:


though plone.app.upgrade needs according upgradesteps for existing installations ...

2 Likes