0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2024-12-22 07:13:08 -05:00
Commit graph

655 commits

Author SHA1 Message Date
Neil Jenkins
1d03266b05 Disable Grammarly extension
The extension does not handle rich text inputs well at all and causes various
broken behaviour, such as weird line breaks.
2020-04-27 16:19:20 +10:00
Tim Gates
8cc1e34a6c docs: Fix simple typo, unfocussable -> unfocusable
There is a small typo in build/squire-raw.js, source/Node.js.

Should read `unfocusable` rather than `unfocussable`.
2020-04-14 21:50:33 +10:00
Neil Jenkins
e1e8ec78cb Remove uneditable container entirely on delete/backspace
If you backspace/delete to remove an uneditable block, we should be checking if
it's part of a larger uneditable container and if so removing the whole thing.
2020-03-29 13:42:15 +11:00
Neil Jenkins
374d067ef3 Fix capitalisation of "Fastmail" in readme 2020-03-11 14:52:16 +11:00
Neil Jenkins
07b459db3b Remove support for IE<11 2020-03-11 14:48:48 +11:00
Neil Jenkins
58321e5504 Remove support for pre-Chromium Opera 2020-03-11 14:47:14 +11:00
Neil Jenkins
b36a35faf4 Remove polyfill for FF3.5
That's way too old to support any more.
2020-03-11 14:36:30 +11:00
Neil Jenkins
e1f982a3dd Detect iOS when it's an iPad pretending to be a Mac 2020-03-11 14:35:50 +11:00
Neil Jenkins
2d307ba54a Fix first line of plain text paste not HTML escaped 2020-03-10 18:46:40 +11:00
Neil Jenkins
f6d6ac8ca0 Pasting plain text on a blank line should keep line's formatting 2020-03-02 10:23:24 +11:00
Neil Jenkins
ede1991931 Fix typo and whitespace issues 2020-03-02 10:21:23 +11:00
Neil Jenkins
c5a7c622fe Preserve target block formatting when pasting inline text
If you have a document like this:

<div style="font-size:20px">XXXX</div>
<div style="font-size:14px">YYYY</div>

and you select the YYYY text and copy it, we just copy the text to the clipboard
and not the block formatting. This is fine.

Now you select XXXX and paste. Because that removes all content from the first
block we were replacing it with the block formatting from the clipboard. But
this has no block formatting, so you essentially just "lost" the font-size:20px,
which broke user expectations.

(If the copied text *did* have block formatting, then replacing the block is
the correct thing to do in this case, which we still do.)
2020-02-24 14:50:22 +11:00
Neil Jenkins
2799f172ee Preserve all span attributes
When cleaning the span don't remove it, just remove the properties now going
into their own node.
2020-02-24 14:50:03 +11:00
Neil Jenkins
b550de09f0 Don't extract colour into separate <span>s
Because it's the parsed representation, you lose the comments in the
CSS so it breaks the dark mode reverse transform.
2020-02-24 14:49:48 +11:00
Neil Jenkins
8980c1ac4a Skip replacing node if type/class match
Replacing the node risks blatting other properties, so safer not to if it
already seems to be the right sort.
2020-02-24 14:49:30 +11:00
Neil Jenkins
9916a4c300 Improve link detection regexp.
Fixes the pathological handling of unmatched brackets, which could hang the
browser. Adds support for mailto: query params. Removes support for nested
parentheses in URLs, as these are rare. Adds comment with formatted version of
regex to make it easier to modify in future.
2020-02-24 14:48:46 +11:00
Neil Jenkins
f8a5b1ee19 Don't try to rewrite style of <p>
This was the only block-level element being rewritten, and could result in some
strange effects. For example, when you move a background colour from the <p> to
a <span>, it renders very differently. It was already inconsistent to do this
for <p> but not for <div>, and better just to drop it.
2020-02-24 14:47:33 +11:00
Neil Jenkins
af93577405 Clone all attributes when replacing tags
This makes it more likely to preserve the visual result.
2020-02-24 14:46:41 +11:00
Neil Jenkins
2cfba2cf1d Don' use default block style to replace <br>s
When converting <br>s to our preferred <div> style in fixContainer,
we don't want to use the default block style as that may change the
visual output. We always want to just use a basic <div>; the only
purpose is for line breaks.
2020-02-24 14:46:41 +11:00
Neil Jenkins
43646a062f Remove redundant property lookup
We already have it in a variable, just use that.
2020-02-24 14:46:41 +11:00
Limon Monte
9c6a3f6983 bump build files 2019-12-30 13:14:33 +11:00
Limon Monte
1850e2cdae Add config.addLinks 2019-12-30 13:14:33 +11:00
Neil Jenkins
9218c9ba14 Fix iOS auto-capitalisation on enter 2019-11-20 22:52:36 +08:00
Neil Jenkins
dcd121a65a Ignore shift key on enter on iOS 2019-11-20 22:10:05 +08:00
Neil Jenkins
15f9b46728 Handle clipboard on iOS again
The WebKit bug (https://bugs.webkit.org/show_bug.cgi?id=143776) was fixed back
in iOS 11.4.

This reverts 3be9a7dea8.
2019-11-17 10:21:33 +08:00
Neil Jenkins
3dc4f201d9 Don't autoscroll on focus
If the rich text view is inside an overflow:scroll, every time you add a link
or do something else that requires we programatically focus the editor it would
jump the scroll back to the top; very annoying.
2019-09-25 20:49:56 -04:00
Neil Jenkins
6b85bda364 Handle pasting text/uri-list 2019-03-25 15:40:41 -04:00
Neil Jenkins
43b2c6b0e1 Insert table rather than image on paste from Excel 2019-02-21 16:31:06 +11:00
Neil Jenkins
2059c5a4ae Fix pasting image copied from browser 2019-01-10 15:18:24 +11:00
Neil Jenkins
892986b17c Don't crash removing list if no <li> inside 2018-10-19 11:54:05 +11:00
Neil Jenkins
7cef58bda8 Release v1.9.0 2018-10-15 08:40:29 +11:00
Neil Jenkins
5b998f5b6f Fix Kana-Kanji input on Mac Safari
Resolves #332
2018-10-15 08:40:10 +11:00
Neil Jenkins
fddf91b9c8 Update readme 2018-10-05 17:01:12 +10:00
Neil Jenkins
79e65240bd Make detect-link regular expression customisable
Resolves #313
2018-10-05 17:00:09 +10:00
Neil Jenkins
b14ae45b38 Escape <a> on space even if in nested tags
Fixes #326
2018-10-05 16:25:28 +10:00
Neil Jenkins
9b654a82b1 Convert adjacent space to nbsp when extracting range
This resolves the issue where if you selected a word and then typed to replace
it, the following space would be deleted as well.

Fixes #331
2018-10-05 11:36:20 +10:00
Neil Jenkins
625d10139e Add support for <pre>/<code> formatting 2018-07-27 10:47:38 +10:00
Neil Jenkins
e07150192f Make shift-enter always just add <br> 2018-07-27 09:23:26 +10:00
Neil Jenkins
2d5114c669 Make TreeWalker filter argument optional 2018-07-27 09:22:06 +10:00
Neil Jenkins
e3e7c17315 Add config.willCutCopy option
Is an optional function that transforms the HTML being cut/copied before
placing it on the clipboard.
2018-07-12 15:40:01 +10:00
Neil Jenkins
f0594091c5 Allow class names to be configured 2018-07-12 15:22:18 +10:00
Neil Jenkins
7a24d6c505 Make check for link protocol case-insensitive
Resolves #308.
2018-06-23 14:39:59 +10:00
Neil Jenkins
35a25e6d44 Simplify regex for matching link query params 2018-06-23 14:35:16 +10:00
dhoko
55fa0ae8e9 Build lib 2018-06-23 14:21:47 +10:00
dhoko
10bf787651 Parse url and create anchor with queryparams 2018-06-23 14:21:46 +10:00
Neil Jenkins
db005b379b Make createRange method public 2018-05-09 17:43:11 +10:00
Neil Jenkins
74d0127974 Release v1.8.14 2018-04-04 20:15:30 +10:00
Neil Jenkins
23b95e6594 Update built version from latest source 2018-04-04 20:14:53 +10:00
Neil Jenkins
00dbc089c4 Fix documentation error 2018-04-04 14:41:18 +10:00
Neil Jenkins
7131fee891 Release v1.8.13 2018-03-26 10:06:44 +01:00