Opened 5 years ago

Closed 4 years ago

#12210 closed Bug (wontfix)

Source code formatting is invalid when startupMode source is enabled

Reported by: Wiktor Walc Owned by:
Priority: Normal Milestone:
Component: General Version: 3.6.6
Keywords: Cc:

Description (last modified by Wiktor Walc)

When startupMode is set to "source" then the source code that appears on startup is broken:

  • It is indented by 4 tab characters
  • New line characters are missing

After switching to wysiwyg mode and back the source code looks fine.

Confirmed in 4.4.3 and in 3.6.6, did not check earlier versions.

How it looks on startup:

How it should look like:

Attachments (2)

startup_source.png (44.6 KB) - added by Wiktor Walc 5 years ago.
correct_formatting.png (45.0 KB) - added by Wiktor Walc 5 years ago.

Download all attachments as: .zip

Change History (8)

Changed 5 years ago by Wiktor Walc

Attachment: startup_source.png added

Changed 5 years ago by Wiktor Walc

Attachment: correct_formatting.png added

comment:1 Changed 5 years ago by Wiktor Walc

Description: modified (diff)

comment:2 Changed 5 years ago by Wiktor Walc

Status: newconfirmed

comment:3 Changed 5 years ago by Piotrek Koszuliński

Status: confirmednew

According to what Fred told me once, this may be intentional. If source mode is enabled it disables CKEditor's data processor and filters. Similar thing happen when you submit a form while editor is in source mode - content is not filtered and this according to Fred is a correct behaviour. I think that this issue is of the same nature. Source mode is a source mode, the end. Source mode displays the source that was loaded and if that source mode is incorrectly formatted, then it's an integration failure.

comment:4 Changed 5 years ago by Wiktor Walc

Alright, this reasoning may make some sense. In the meantime, for anyone looking for a solution for the issue described here:

editor.on('instanceReady', function() {
	// Start in source mode with correct formatting
	this.setMode('source');
});
Last edited 5 years ago by Wiktor Walc (previous) (diff)

comment:5 Changed 5 years ago by Piotrek Koszuliński

Personally I've got a little bit different opinion on that and I would expect that editor will work differently in both mentioned cased. However, I'm sure that there are more people expecting it to work just like now, so there's the usual conflict of expectations.

comment:6 Changed 4 years ago by Jakub Ś

Resolution: wontfix
Status: newclosed

Since there reasoning behind editor working that way and there is a simple workaound for it with editor API, I think we can close this ticket as "won't fix".

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy