From 92dcbbe7d80059c6016d1741acdde03aeb261307 Mon Sep 17 00:00:00 2001 From: david ruty Date: Tue, 25 Jun 2024 17:08:53 +0200 Subject: [PATCH 1/6] LIST CLASSNAME FIX --- packages/quill/src/core/editor.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/quill/src/core/editor.ts b/packages/quill/src/core/editor.ts index a19485840d..ee7a2c8635 100644 --- a/packages/quill/src/core/editor.ts +++ b/packages/quill/src/core/editor.ts @@ -337,20 +337,24 @@ function convertListHTML( } const [{ child, offset, length, indent, type }, ...rest] = items; const [tag, attribute] = getListType(type); + // CLASSNAME FIX + const className=(child.domNode).className!=""?` class="${(child.domNode).className}"`:""; if (indent > lastIndent) { types.push(type); if (indent === lastIndent + 1) { - return `<${tag}>${convertHTML( + // CLASSNAME FIX + return `<${tag}>${convertHTML( child, offset, length, )}${convertListHTML(rest, indent, types)}`; } - return `<${tag}>
  • ${convertListHTML(items, lastIndent + 1, types)}`; + return `<${tag}>${convertListHTML(items, lastIndent + 1, types)}`; } const previousType = types[types.length - 1]; if (indent === lastIndent && type === previousType) { - return `
  • ${convertHTML( + // CLASSNAME FIX + return `${convertHTML( child, offset, length, From 9edee1d93fc994138d70f5baeb7c199fcf4d2903 Mon Sep 17 00:00:00 2001 From: david ruty Date: Wed, 26 Jun 2024 13:34:48 +0200 Subject: [PATCH 2/6] =?UTF-8?q?Error:=20=20=20341:18=20=20error=20=20Repla?= =?UTF-8?q?ce=20`=3D(child.domNode).className!=3D""=3F`?= =?UTF-8?q?=C2=B7class=3D"${(child.domNode).className}"`:""?= =?UTF-8?q?`=20with=20`=C2=B7=3D=E2=8F=8E=C2=B7=C2=B7=C2=B7=C2=B7(child.domNode).className=C2=B7!=3D=C2=B7''=E2=8F=8E?= =?UTF-8?q?=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=3F=C2=B7`=C2=B7class=3D"${?= =?UTF-8?q?(child.domNode).className}"`=E2=8F=8E=C2=B7?= =?UTF-8?q?=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7:=C2=B7''`=20=20prettier/prettier?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/quill/src/core/editor.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/quill/src/core/editor.ts b/packages/quill/src/core/editor.ts index ee7a2c8635..384bd487fb 100644 --- a/packages/quill/src/core/editor.ts +++ b/packages/quill/src/core/editor.ts @@ -338,7 +338,9 @@ function convertListHTML( const [{ child, offset, length, indent, type }, ...rest] = items; const [tag, attribute] = getListType(type); // CLASSNAME FIX - const className=(child.domNode).className!=""?` class="${(child.domNode).className}"`:""; + const className=(child.domNode).className!="" + ?` class="${(child.domNode).className}"` + :""; if (indent > lastIndent) { types.push(type); if (indent === lastIndent + 1) { From d5ae75ffa9316e1f2b481a3c8bcc43a8e6704179 Mon Sep 17 00:00:00 2001 From: david ruty Date: Wed, 26 Jun 2024 15:18:22 +0200 Subject: [PATCH 3/6] pretier --- packages/quill/src/core/editor.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/quill/src/core/editor.ts b/packages/quill/src/core/editor.ts index 384bd487fb..d7f08b2e95 100644 --- a/packages/quill/src/core/editor.ts +++ b/packages/quill/src/core/editor.ts @@ -338,9 +338,7 @@ function convertListHTML( const [{ child, offset, length, indent, type }, ...rest] = items; const [tag, attribute] = getListType(type); // CLASSNAME FIX - const className=(child.domNode).className!="" - ?` class="${(child.domNode).className}"` - :""; + const className= (child.domNode).className != '' ? ` class="${(child.domNode).className}"` : ""; if (indent > lastIndent) { types.push(type); if (indent === lastIndent + 1) { From 8c682987f71c809168d846b99cf4d207548c0e35 Mon Sep 17 00:00:00 2001 From: david ruty Date: Thu, 27 Jun 2024 16:46:32 +0200 Subject: [PATCH 4/6] pretier --- packages/quill/src/core/editor.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/quill/src/core/editor.ts b/packages/quill/src/core/editor.ts index d7f08b2e95..f59f6ada94 100644 --- a/packages/quill/src/core/editor.ts +++ b/packages/quill/src/core/editor.ts @@ -338,7 +338,10 @@ function convertListHTML( const [{ child, offset, length, indent, type }, ...rest] = items; const [tag, attribute] = getListType(type); // CLASSNAME FIX - const className= (child.domNode).className != '' ? ` class="${(child.domNode).className}"` : ""; + const className = + (child.domNode).className != '' + ? ` class="${(child.domNode).className}"` + : ""; if (indent > lastIndent) { types.push(type); if (indent === lastIndent + 1) { From c3ea6788b97f0457491eb29c1640c6eddd5ac824 Mon Sep 17 00:00:00 2001 From: david ruty Date: Fri, 28 Jun 2024 09:44:33 +0200 Subject: [PATCH 5/6] pretier --- packages/quill/src/core/editor.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/quill/src/core/editor.ts b/packages/quill/src/core/editor.ts index f59f6ada94..4b5a22ac8b 100644 --- a/packages/quill/src/core/editor.ts +++ b/packages/quill/src/core/editor.ts @@ -338,10 +338,10 @@ function convertListHTML( const [{ child, offset, length, indent, type }, ...rest] = items; const [tag, attribute] = getListType(type); // CLASSNAME FIX - const className = + const className = (child.domNode).className != '' ? ` class="${(child.domNode).className}"` - : ""; + : ''; if (indent > lastIndent) { types.push(type); if (indent === lastIndent + 1) { From 1e3e4d194a8c8d3843fa1071b6641012d7c639d3 Mon Sep 17 00:00:00 2001 From: david ruty Date: Fri, 26 Jul 2024 09:36:40 +0200 Subject: [PATCH 6/6] fix li class --- packages/quill/test/unit/core/editor.spec.ts | 21 ++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/packages/quill/test/unit/core/editor.spec.ts b/packages/quill/test/unit/core/editor.spec.ts index 0c595332bb..b685415b67 100644 --- a/packages/quill/test/unit/core/editor.spec.ts +++ b/packages/quill/test/unit/core/editor.spec.ts @@ -1287,10 +1287,10 @@ describe('Editor', () => {
  • e
  • Two
      -
    • Alpha +
    • Alpha
        -
      1. I
      2. -
      3. II
      4. +
      5. I
      6. +
      7. II
    @@ -1318,10 +1318,10 @@ describe('Editor', () => {
  • e
  • Two
      -
    • Alpha +
    • Alpha
        -
      • I
      • -
      • II
      • +
      • I
      • +
      • II
    @@ -1343,16 +1343,17 @@ describe('Editor', () => { `, ); + console.log(editor.getHTML(12, 12)); expect(editor.getHTML(12, 12)).toEqualHTML(`
      -
    1. +
      1. -
      2. +
        1. -
        2. II
        3. +
        4. II
      3. -
      4. BBBB
      5. +
      6. BBBB
    2. 2222