The default rich text configuration is unable to be overrided.
Steps to reproduce it at https://rgadp.ply.st/:
- Login
- Go to https://rgadp.ply.st/admin/config/content/formats/manage/rich_text
- Change the default configuration of the rich text by adding more buttons like align right, align left , center, etc.
- Go ahead and try to add a Basic page https://rgadp.ply.st/node/add/page
- You wont see your configuration
Since you are overriding the configuration you expect to see it, I've tried exported the configuration to a new feature and it is not possible to add single extra formats. the same happens with the Underline.
I believe the priority is Major since lot of editors would like to add single tools like this to the wysiwyg.
Comments
Comment #2
acidaniel commentedComment #3
balsamaI was able to reproduce this and added it to our 2.1.4 sprint.
Comment #4
phenaproximaConfirmed, and I agree that this is major. Will work on it.
Comment #5
phenaproximaI talked about this extensively with @Wim Leers, who knows the Editor, CKEditor, and Filter modules inside and out.
The problem here basically boils down to the Allowed HTML filter, which is enabled with the Rich Text format in Lightning, and which exerts a strong influence on which buttons actually show up in any given editor instance, and which can under certain circumstances disregard the way the editor has been configured by the site builder. Therefore, the quick workaround here is to totally disable the Allowed HTML filter -- but that is a dangerous idea because it's a potential security hazard, and emphatically not recommended.
The point here is that some buttons will work, and some will not. The alignment buttons, in particular, are known to be broken: #2649546: [upstream] Alignment/justify buttons not appearing for CKEditor, <p class="text-align-left text-align-center text-align-right text-align-justify"> not being allowed automatically.
A major part of the problem, as Wim explained, is that these parts of core have next to zero JavaScript test coverage, which would likely have caught such problems early on...but JavaScript testing did not come to core until Drupal 8.1.0. So this stuff is way older than any JavaScript tests. Another aspect of it is that the problem may be due to a bug or as-yet unknown regression in CKEditor. Or, it might be due to a bug in Drupal itself. Without JavaScript test coverage, we simply can't be certain.
Wim sent me to the related issues I am attaching to this comment. He also said that three things would be incredibly valuable towards fixing this:
In any event, it seems pretty clear that the problem here is core, not Lightning itself. Therefore, I'm closing it. Even though it doesn't work as intended, this is not a problem that Lightning itself is introducing. It would be helpful to follow the related issues, and hopefully write tests and work towards fixing them all. I'm not sure that Lightning will be able to devote time to this -- there is just too much on our plate and never enough resources. But it is at least worth documenting all of this here.
Comment #6
balsamaTo be clear, the simple workaround here is to whitelist the HTML tags in your Allowed HTML tags filter settings. For example, if you want to include the justify left, center, and right buttons, you will also need to add the classes used by those buttons to the p tag like this:
<p class="text-align-left text-align-center text-align-right">The core issues referenced above are about automatically whitelisting tags when buttons are added.
Comment #7
acidaniel commented@balsama's Workaround works I tested.