Skip to content

confusing br-tag at the end of text #1438

Description

@liedekef

Jodit Version

4.3.16

Browser

Chrome

Operating System

Linux

Is React App?

No

Reproduced on xdsoft.net?

Yes

Code to reproduce

clear the complete content and add just 1 word "test" , without newline
Visual: 1 line with just the word "test", typing can only happen at the end of the word
Created code:
<p>test<br></p>
So a newline after the word "test" in the resulting html.
Adding an enter results in:
<p>test</p><p><br></p>
Adding a word on the newly created line results in:
<p>test</p><p>test</p>
Now removing the second line and the result is:
<p>test</p>

If you set the config option "enter" to "br", it gets even more confusing:
clear the complete content and add just 1 word "test" , without newline
Visual: 1 line with just the word "test", typing can only happen at the end of the word
Created code:

Perfect as expected.
Adding an enter results in:
<br><br>
Adding a word on the newly created line results in:
<br>test
Now removing the second line and the result is:
<br>

Expected behavior

In the normal setup, the created first line should be
<p>test</p>
if no enter is done
In the case the option "enter" is set to "br", the result should be
test
no br if no next line is intended.

Actual behavior

currently I use it with my wordpress plugin (set enter=br) and the (or lack of ) br at the end can lead to unexpected results

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions