Skip to content

Commit

Permalink
Merge pull request #11 from miroapp/MDOCS-2491
Browse files Browse the repository at this point in the history
MDOCS-2491
  • Loading branch information
bmakuh authored Jan 30, 2025
2 parents 788a66a + bcbaaf2 commit a18c41c
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 29 deletions.
38 changes: 21 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/quill/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "quill",
"version": "2.0.4-beta.13",
"version": "2.0.4-beta.15",
"description": "Your powerful, rich text editor",
"author": "Jason Chen <[email protected]>",
"homepage": "https://quilljs.com",
Expand All @@ -17,7 +17,7 @@
"@babel/core": "^7.24.0",
"@babel/preset-env": "^7.24.0",
"@babel/preset-typescript": "^7.23.3",
"@playwright/test": "1.44.1",
"@playwright/test": "1.50.0",
"@types/highlight.js": "^9.12.4",
"@types/lodash-es": "^4.17.12",
"@types/node": "^20.10.0",
Expand Down
7 changes: 3 additions & 4 deletions packages/quill/src/modules/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Delta from 'quill-delta';
import Module from '../core/module.js';
import Quill from '../core/quill.js';
import type { Range } from '../core/selection.js';
import { CHECK_KOREAN, deleteRange, ZERO_SPACE } from './keyboard.js';
import { deleteRange, ZERO_SPACE } from './keyboard.js';

const INSERT_TYPES = ['insertText', 'insertReplacementText'];

Expand Down Expand Up @@ -57,10 +57,9 @@ class Input extends Module {
// eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
range?.index!,
);
const text = getPlainTextFromInputEvent(event);
// In the case that we are typing Korean at the beginning of a new line, sometimes
// In the case that we are typing Korean/Japanese (Romaji) at the beginning of a new line, sometimes
// jamo do not compose together as expected but placing a ZWSP immediately before fixes this problem
if (range && offset === 0 && text && CHECK_KOREAN.test(text)) {
if (range && offset === 0 && this.quill.composition.isComposing) {
this.quill.insertText(range.index, ZERO_SPACE, 'user');
}

Expand Down
1 change: 0 additions & 1 deletion packages/quill/src/modules/keyboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,6 @@ class Keyboard extends Module<KeyboardOptions> {
}

handleDelete(range: Range, context: Context) {
// const text = context.suffix;
// Check for astral symbols
const length = /^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(context.suffix)
? 2
Expand Down
3 changes: 2 additions & 1 deletion packages/quill/test/unit/core/composition.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ describe('Composition', () => {
const scroll = new Scroll(createRegistry(), document.createElement('div'), {
emitter,
});
new Composition(scroll, emitter);
const composition = new Composition(scroll, emitter);

vitest.spyOn(emitter, 'emit');

const event = new CompositionEvent('compositionstart');
scroll.domNode.dispatchEvent(event);
composition.isComposing = false;
const updateEvent = new CompositionEvent('compositionupdate');
scroll.domNode.dispatchEvent(updateEvent);
expect(emitter.emit).toHaveBeenCalledWith(
Expand Down
6 changes: 3 additions & 3 deletions packages/quill/test/unit/core/editor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1257,17 +1257,17 @@ describe('Editor', () => {
0,
11,
),
).toEqual('<strong>123&nbsp;</strong>123<em>&nbsp;123</em>');
).toEqual('<strong>123 </strong>123<em> 123</em>');

expect(createEditor(new Delta().insert('1 2\n')).getHTML(0, 5)).toEqual(
'1&nbsp;&nbsp;&nbsp;2',
'1 2',
);

expect(
createEditor(
new Delta().insert(' 123', { bold: true }).insert('\n'),
).getHTML(0, 5),
).toEqual('<strong>&nbsp;&nbsp;123</strong>');
).toEqual('<strong> 123</strong>');
});

test('mixed list', () => {
Expand Down
3 changes: 2 additions & 1 deletion packages/quill/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"moduleResolution": "bundler",
"strictNullChecks": true,
"noImplicitAny": true,
"noUnusedLocals": true
"noUnusedLocals": true,
"skipLibCheck": true
},
"include": ["src/**/*", "test/**/*"]
}

0 comments on commit a18c41c

Please sign in to comment.