0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2024-12-22 15:23:29 -05:00
Commit graph

8 commits

Author SHA1 Message Date
Neil Jenkins
3def29e081 Fix merging text nodes after delete
startContainer is not necessarily a sibling to endContainer at this
point. endContainer is definitely at the right level of the hierarchy
so instead just get the previous sibling from this and merge with that
if it's also a text node.
2024-07-18 13:04:35 +10:00
Neil Jenkins
752a42d917 Fix Firefox cursor position bug after paste
We merge a faux block with contents from after a split point when
inserting HTML. The merge function presumes this block has already had
fixCursor run on it to ensure we add the <br>s some browsers need to
support correct cursor focusing.

Fixes #451
2023-12-20 14:17:34 +11:00
Neil Jenkins
96e4bf2e98 Replace nbsp with regular sp when extracting text
The nbsp are used by the browser to stop HTML white space collapsing
from applying, but we don't want them in the plain text version.
2023-10-02 13:23:12 +11:00
Neil Jenkins
3937c10b55 Extract getTextContentsOfRange helper fn 2023-10-02 13:12:51 +11:00
Neil Jenkins
2d37608aac Ignore ZWS when determining if at block boundary
These are just added to allow Chrome to focus an empty text node, but
they should not be considered "real" content.
2023-09-27 14:51:26 +10:00
Neil Jenkins
4306cecb6e Remove multiple adjacent empty text nodes
Fix the loop condition so this will remove multiple adjacent empty
text nodes if necessary.
2023-02-20 10:17:56 +11:00
Neil Jenkins
b85754ca50 Handle empty nodes in moveRangeBoundariesDownTree
Empty text nodes next to another text node can always be safely
eliminated.
2023-02-01 14:19:52 +11:00
Neil Jenkins
fe0dfdf6c4 Squire 2.0
This is a massive refactor to port Squire to TypeScript, fix a bunch of small
bugs and modernise our tooling. The development was done on an internal
repository, so apologies to anyone following externally for the commit dump;
updates from here should come as real commits again.

Co-authored-by: Joe Woods <woods@fastmailteam.com>
2023-01-23 13:18:29 +11:00