Skip to content
This repository has been archived by the owner on Dec 12, 2019. It is now read-only.

Opening and closing the source editor adds tags with non-breaking spaces to top of content #37

Closed
cdaveb opened this issue Mar 6, 2018 · 2 comments

Comments

@cdaveb
Copy link

cdaveb commented Mar 6, 2018

I've noticed that there seems to be an issue where if you open and then close the codemirror source editor in TinyMCE it seems to insert empty tags (p tags if forced_root_block is not set to div, otherwise div tags) at the top of the content. This only seems to happen if you close the editor and your cursor is not within an existing tag. It will continue to keep inserting blank tags at the start (i.e. <p>&nbsp;</p> or <div>&nbsp;</div>) at the top of the source everytime you close and reopen the editor. I can't reproduce this issue in the standard TinyMCE source editor- it only happens when I use codemirror.

For example, see these pictures of what happens each time you reopen the source editor and close it.
screen shot 2018-03-06 at 2 08 57 pm

screen shot 2018-03-06 at 2 09 21 pm

screen shot 2018-03-06 at 2 09 38 pm

@vince2corte
Copy link

vince2corte commented Mar 6, 2019

Hi !
I have the same problem.
I use TinyMCE 4.9.3 - CodeMirror 5.44.0 - Firefox 65.
Any idea to solve that problem ? Thanx !

Edit :
Well, I think I solved the problem with a little conf of TynyMCE. I added thoses lines :

entity_encoding: "raw",
force_p_newlines : true,
forced_root_block : "",

I don't know if "raw" is required, but I didn't want HTML entities in my code, so it'just good for me. Hope this will help !

@thomich thomich closed this as completed Jul 31, 2019
@thomich
Copy link
Collaborator

thomich commented Jul 31, 2019

Please check: #46

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants