Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enter key before ending tag generate 2 br #3588

Closed
ghost opened this issue Apr 18, 2017 · 5 comments
Closed

enter key before ending tag generate 2 br #3588

ghost opened this issue Apr 18, 2017 · 5 comments

Comments

@ghost
Copy link

ghost commented Apr 18, 2017

Do you want to request a feature or report a bug?

What is the current behavior?

**If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via fiddle.tinymce.com or similar.

What is the expected behavior?

Which versions of TinyMCE, and which browser / OS are affected by this issue? Did this work in previous versions of TinyMCE?

@ghost
Copy link
Author

ghost commented Apr 18, 2017

If I press enter in the middle of a paragraph I get one linebreak br , If I do the same thing just before an ending tag I get 2 linebreak

@ghost
Copy link
Author

ghost commented Apr 18, 2017

@fyrkant
Copy link

fyrkant commented Apr 18, 2017

Hi!
Could you reproduce the issue in a fiddle?

@ghost
Copy link
Author

ghost commented Apr 18, 2017

I dont know how to use fiddle (in that case)
but if you put the cursor before the ending h2 and press enter you get this
<h2>any content<br /><br /></h2>

anywhere else you get this
<h2>any<br />content</h2>

it seems to have something to do with EditorCommands.js#L641-L650

if (container && container.nodeType == 3 && offset >= container.nodeValue.length) {
            // Insert extra BR element at the end block elements
            if (!isOldIE && !hasRightSideContent()) {
              brElm = dom.create('br');
              rng.insertNode(brElm);
              rng.setStartAfter(brElm);
              rng.setEndAfter(brElm);
              extraBr = true;
            }
          }

@thedrjim
Copy link

This issue has been closed due to inactivity. Tiny will soon be working with members of the community to close other old issues on our GitHub repositories.
There are some excellent discussions and reports in the main TinyMCE GitHub repository, but with so many open issues, we cannot monitor them all. Reviewing all of the issues individually would be an enormous task, requiring time that could be better spent developing new features and fixing bugs. Therefore, we are closing issues that have been inactive for over 365 days, with some exceptions.
If this issue is still relevant, please re-open this issue or create a new one.
If you have any questions or concerns, you can contact me at community-qa@tiny.cloud. You can also join the discussion on our mailing list at the following link: community-qa+subscribe@tiny.cloud.

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

No branches or pull requests

2 participants