Open zaqijr7 opened 2 weeks ago
Same here, using
"ngx-quill": "^26.0.8",
"quill": "^2.0.2",
in Angular 18 application.
same using:
"quill": "^2.0.2",
"primevue": "^3.50.0",
"vue": "^3.0.0"
when click on <ul>
in Quill editor is generated <ol>
! How getSemanticHTML()
will solve this wrong HTML tag? A bit confused with this. I have Svelte 5 project but IMO this issue is framework agnostic as it is IMO Quill core issue.
npm install quill@2.0.2
import 'quill/dist/quill.snow.css'; import 'quill/dist/quill.core.css';
interface EditorProps { readOnly?: boolean; defaultValue?: Delta; onTextChange?: (_delta: Delta, _oldDelta: Delta, _source: string) => void; onSelectionChange?: ( _range: Range | null, _oldRange: Range | null, _source: string ) => void; }
Quill.register({ 'modules/toolbar': Toolbar, 'themes/snow': Snow, 'themes/bubble': Bubble, 'formats/bold': Bold, 'formats/italic': Italic, 'formats/header': Header, 'formats/list': List, 'formats/link': Link, });
const Editor = forwardRef<Quill | null, EditorProps>( ({ readOnly, defaultValue, onTextChange, onSelectionChange }, ref) => { const containerRef = useRef<HTMLDivElement | null>(null); const defaultValueRef = useRef<Delta | undefined>(defaultValue); const onTextChangeRef = useRef(onTextChange);
const onSelectionChangeRef =
useRef(onSelectionChange);
} );
Editor.displayName = 'Editor';
export default Editor;
import React, { useRef, useState } from 'react'; import Editor from './Editor'; import Quill, { Delta as Deltas, Range } from 'quill/core';
type RangeType = Range | null; type TextChangeType = { delta: Deltas; oldDelta: Deltas; source: string };
const Delta = Quill.import('delta');
const TextEditor: React.FC = () => { const [range, setRange] = useState(null);
const [lastChange, setLastChange] = useState<TextChangeType | null>(null);
const [readOnly, setReadOnly] = useState(false);
const quillRef = useRef<Quill | null>(null);
return (
); };
export default TextEditor;
"quill": "2.0.2", "react": "^18.3.1",