Skip to content

Conversation

web-padawan
Copy link
Member

@web-padawan web-padawan commented Apr 25, 2025

Description

Fixes #1680

Type of change

  • Breaking change

@TatuLund
Copy link
Contributor

TatuLund commented Apr 25, 2025

Updated some tests where htmlValue contains   instead of regular whitespace (is this a bug?)

@web-padawan Not a bug, but by design how some Quill internal tags were removed to clean the html value: #6434 So I think change is valid as Quill has now method to get html value instead of our own hack.

@web-padawan web-padawan force-pushed the proto/quill-v2 branch 3 times, most recently from a4ebd07 to d025045 Compare April 25, 2025 13:44
@web-padawan
Copy link
Member Author

web-padawan commented Apr 25, 2025

Not a bug, but by design how some Quill internal tags were removed to clean the html value: #6434

I'm talking about a different logic added in #6651 and #6652 as a fix for vaadin/flow-components#5533.
So the following test now fails as getSemanticHTML() returns ' ' for preserved whitespaces.

it('should not lose extra space characters from the resulting htmlValue', () => {
const htmlWithExtraSpaces = '<p>Extra spaces</p>';
rte.dangerouslySetHtmlValue(htmlWithExtraSpaces);
flushValueDebouncer();
expect(rte.htmlValue).to.equal(htmlWithExtraSpaces);
});

UPD: this was introduced in slab/quill#4502 which landed in v2.0.3 patch release and a number of users were upset and had to pin to v2.0.2 - see discussion at slab/quill#4502 (comment) and this issue: slab/quill#4509

@web-padawan web-padawan force-pushed the proto/quill-v2 branch 5 times, most recently from a93b758 to 59f4891 Compare April 26, 2025 07:53
@web-padawan
Copy link
Member Author

Updated the Quill fork to apply the workaround from slab/quill#4509 (comment), see vaadin/quill@76a4568.
This replaces all but one consecutive space character with &nbsp;, which should be less intrusive.

Copy link

@web-padawan web-padawan changed the title refactor!: update to Quill v2, drop outdated Firefox patch refactor!: update to Quill v2.0 and use getSemanticHTML Jun 4, 2025
@web-padawan
Copy link
Member Author

Updated Quill fork branch with support for ES module distribution: https://github.com/vaadin/quill/tree/vaadin-quill-v2

Tested and it works fine in dev page (and all web component tests are passing). This would enable us to do the following:

-import '../vendor/vaadin-quill.js';
+import Quill from '@vaadin/quill/vaadin-quill.js';

-const Quill = window.Quill;
+// For backwards compatibility
+window.Quill = Quill;

And then we can publish the fork to npm as @vaadin/quill instead of having to copy a minified version for every change.

@web-padawan web-padawan marked this pull request as ready for review June 4, 2025 12:21
Copy link

sonarqubecloud bot commented Jun 4, 2025

@ugur-vaadin ugur-vaadin marked this pull request as draft August 6, 2025 06:51
@web-padawan web-padawan force-pushed the proto/quill-v2 branch 3 times, most recently from 7cbb390 to bbf4d36 Compare August 6, 2025 10:17
@web-padawan web-padawan marked this pull request as ready for review August 6, 2025 10:17
@web-padawan
Copy link
Member Author

Created a PR to hide caret in visual test (I noticed one of screenshots has it): #9924

@web-padawan web-padawan force-pushed the proto/quill-v2 branch 4 times, most recently from 3a91293 to c80fbdf Compare August 7, 2025 08:03
@web-padawan web-padawan force-pushed the proto/quill-v2 branch 2 times, most recently from 5cac4d9 to b3e61e9 Compare August 7, 2025 11:47
Copy link

sonarqubecloud bot commented Aug 7, 2025

@ugur-vaadin ugur-vaadin merged commit 9bf3931 into main Aug 11, 2025
9 checks passed
@ugur-vaadin ugur-vaadin deleted the proto/quill-v2 branch August 11, 2025 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider updating to Quill 2.0 once stable is released
3 participants