Unwrapping empty paragraph cause optically change height of empty line.
Also it sometimes may add additional line (ie 10)
Browser + version: ie10/chrome
OS: win
Resolution: 2.0.0-beta.7+
additional styles:
p {
line-height: 16px;
border: solid 1px red; // for problem observation only
}
this fixing problem with changing line height and preventing of insertion additional lines but leaving thrash inside paragraphs with is also no good
1 Remove unvraping block:
// Unwrap paragraphs content, containing nothing usefull
t.$ed.find('p').filter(function () {
....
}).contents().unwrap();
2 Replace enpty <p> with <p/> instead of <br/>
t.$ed.find('p:empty').replaceWith('<p/>');
Thanks for report.
Your bug is due to a non-semantic usage of the editor. You should not have multiple blank lines. It's a WYSIWYG, so if you need a margin, maybe you need to change your CSS to get a clean code and a clean result :)
So, I'm sorry but your work around break a lot of other cases and remove a part of clean up process to get semantic code.
My work around is indeed broken, to make it work I had to remove whole paragraph unwrapping logic.
You should not have multiple blank lines.
I don't think its correct assumption.
Because it will be hard to explain it to end-user who is used to MS Word, and getting more space after hitting Enter.
I would be great if you could find better solution for this problem, because I don't see any other possibility then blocking ability to add multiple lines (with is also not so great)
it will be hard to explain it to end-user who is used to MS Word
If you need to handle this case, don't use Trumbowyg. This WYSIWYG is for semantic and clean result, really based on CSS of the website. If you need some MS Word-like features/behavior, go to another WYSIWYG which have not this philosophy :/
@Alex-D but users don't understand HTML and CSS semantics, they don't care about it. If user need 2 lines break he'll hit enter two times. Or just accidentally... it still will be broken.
So it isn't about semantics but about usability.
Most helpful comment
@Alex-D but users don't understand HTML and CSS semantics, they don't care about it. If user need 2 lines break he'll hit enter two times. Or just accidentally... it still will be broken.
So it isn't about semantics but about usability.