If you're using the 'Source' view of a Content block it opens a new dialog window to add/edit markup. When you click 'OK' your markup is processed e.g. it's some test markup --> <p>it's some test markup</p>.
However, if you use a block that uses an instance of the WYSIWYG (e.g. Feature) the 'Source' view is inline. If a user doesn't switch back to the rich text view before saving, the block will persist the raw text to the DB: it's some test markup.
The next time the block is edited the raw text from the DB will be loaded into the edit view as <p>it's some test markup</p>. This time the user saves the block (even without making any changes) this processed text will replace the raw text in the DB.
The source code editor plugins for CKEditor are primarily intended for HTML editing and not for free form text input. They will handle free form text input, but need an event to trigger the conversion to HTML (clicking the "Source" toolbar button to switch to WYSIWYG editing or clicking "OK" in the source code modal).
This sounds like an issue of end user education. That if you will be pasting content into the source code view instead of the WYSIWYG editor, make sure to switch back to WYSIWYG editing or OK'ing the modal.
Yeah, I guess adding normal text content into the HTML view isn't how this was intended to be used.
But it is odd to get these inconsistencies, especially as the data will be transformed into what it "should" have been the next time you edit the block.
Is there a function that can be run as part of block controller save() to ensure only valid markup is added to the DB? Similar to LinkAbstractor::translateTo(...);?
Seems to fix all my issues! Thanks @mlocati
Thanks for checking, @bikerdave! Could write that also in #8280? That way, reviewers will see that it works when they look at that pull request.
@mlocati to the rescue!
Most helpful comment
8280 should fix this issue