ep_headings2
ep_headings2 copied to clipboard
Paragraph style lost when hitting <enter> on line start
- I am at the editor.
- I add some lines.
- I set one line to Style "Heading 1"
- I move the caret to beginning of this styled line
- I hit ENTER
- The styling looks to be lost. What actually happens: the "Heading 1" styled line is empty, and the content of the styled line is moved one line to bottom and styled as "body text".
Expected behaviour: Move the "Heading 1" style line one line to bottom, and insert an empty line styled as "body text".
Just noticed it removed styling on line before, yea that's an issue.. Minor but could do w/ being resolved..
@JohnMcLear advises: "I'd guess that the contentcollector.js is where the behaviour is. The concept of "line attributes" is not a first class citizen in the web so it's possible we have a bastardization with a missing expectation that they can be moved from line X to Y. Also ensuring that line X has then removed (if expected behaviour). [see also] https://github.com/ether/ep_test_line_attrib"
@webzwo0i says "the ep_headings problem might not be in contentcollector, but https://github.com/ether/etherpad-lite/blob/develop/src/static/js/ace2_inner.js#L2679 the bug also exists for ep_align and I can imagine for all lines with line attributes, that are not lists. basically the * (invisible line marker) is left on the old line, so any attributes that are set on the line marker (and thus on the whole line) won't be applied to the new line. fun: when you do backspace key on the beginning of the new line (without attributes), everything is at its place again. when you do delete on the old line, the * is removed. but this only happens for ep_headings2, with ep_align it works with backspace and delete."