Added another formatText case and new test for it

This commit is contained in:
Aniello Falcone 2018-06-21 11:27:31 +02:00
parent f751931437
commit 8d36dce6aa
2 changed files with 10 additions and 0 deletions

View File

@ -176,6 +176,7 @@ export class Quill implements EventEmitter {
formatText(index: number, length: number, format: string, value: any, source?: Sources): DeltaStatic;
formatText(index: number, length: number, formats: StringMap, source?: Sources): DeltaStatic;
formatText(range: RangeStatic, format: string, value: any, source?: Sources): DeltaStatic;
formatText(range: RangeStatic, formats: StringMap, source?: Sources): DeltaStatic;
getFormat(range?: RangeStatic): StringMap;
getFormat(index: number, length?: number): StringMap;
removeFormat(index: number, length: number, source?: Sources): DeltaStatic;

View File

@ -85,6 +85,15 @@ function test_formatText3() {
quillEditor.formatText(range, 'bold', true);
}
function test_formatText4() {
const quillEditor = new Quill('#editor');
const range = {index: 0, length: 5};
quillEditor.formatText(range, {
bold: false,
color: 'rgb(0, 0, 255)'
});
}
function test_formatLine1() {
const quillEditor = new Quill('#editor');
quillEditor.formatLine(1, 3, 'api');