CKEditor started "minifying" to a degree on Drupal 8.4.1.

Comments

DrupalRanger created an issue. See original summary.

cilefen’s picture

Could you explain a little more what this means exactly and what it would be used for?

Is this a feature of CKeditor itself?

DrupalRanger’s picture

A drupal ckeditor feature itself..

When you click the Source button on the toolbar of ckeditor it shows the source behind the formatting of whatever is in the display window of ckeditor. What I understand from the documentation is that the source code is filtered for whatever settings you designate, like Correct faulty HTML when saved.

In that filtering process, it also filters any formatting you may have placed in your source, like white spaces, to make the html more readable when editing the source. I want to preserve this formatting. In 8.4 it was that you could not add tabs but could add each element to a separate line with "enter". In the 8.4.1 from today I notice that the source is now minified when you open source, which is prob best practice for file size.

Use Case - Sometimes a client or user may want to be able to edit the actual html elements on a production site to add classes or make small tweaks to the structure of the html elements, or in my case the paragraph of paragraphs module. It is certainly not the best idea but there are times when it becomes necessary. When the source is not structured it makes it difficult to find the spot where you want to make the edit. A good example of this in the wild would be with the bootstrap theme to add "muted" a background color class or "mt-3" which is a spacing class.

I am not suggesting this be a default setting as this is probably a rare use case, but it would be nice to have a toggle for each ckeditor type under the enabled filters section. Something like Formatted Source Code, so not to be confused with the ability to add tabs to the actual structure of a list or something like that.

There could be solution out there currently that I am not aware of.

cilefen’s picture

Are you reporting a bug then? #2908864: Update CKEditor library to 4.7.3

cilefen’s picture

Title: Source Formatting » CKeditor minifies source in 8.4.1
Category: Feature request » Bug report
cilefen’s picture

DrupalRanger’s picture

I don't believe this is a bug. I think it is best practice to minify the source output of ckeditor. However, I would like a feature that overrides that function so source formatting can be preserved when editing the source directly.

cilefen’s picture

A behavior changed unexpectedly.

cilefen’s picture

Please try Drupal 8.4.2 and report findings.

DrupalRanger’s picture

8.4.2 Works as expected as source code is not minified.

Orginal Feature Request still open for Formatting capabilities of the source code.

Thanks for all the hard work on this module. Much easier than D7!

cilefen’s picture

Issue summary: View changes
Status: Active » Fixed

@DrupalRanger: I am marking this a fixed bug, so as not to confuse everyone. Please open a new feature request. Please add details of your #3 comment to the issue summary of that issue. Thank you!

wim leers’s picture

Title: CKeditor minifies source in 8.4.1 » CKEditor minifies source in 8.4.1
Category: Bug report » Support request

Status: Fixed » Closed (fixed)

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