soccerloway / quill-better-table

Module for better table in Quill, more useful features are supported.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

inserting <p> tag instead of table

sunilpune opened this issue · comments

APP.COMPONENT.TS

`import {Component, OnInit, AfterViewInit, ViewChild, ElementRef} from '@angular/core';

import QuillBetterTable from 'quill-better-table';

declare const Quill: any;

@component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.less']
})
export class AppComponent implements OnInit, AfterViewInit {
@ViewChild('editable', {static: true}) editRef: ElementRef;

quill: any;

ngOnInit() {
setTimeout(() => {
this.initEditor();
}, 1000);
}

initEditor(): void {
Quill.register({
'modules/better-table': QuillBetterTable
}, true);
// tslint:disable-next-line:no-unused-expression
this.quill = new Quill(this.editRef.nativeElement, {
theme: 'snow',
modules: {
table: false,
'better-table': {
operationMenu: {
items: {
unmergeCells: {
text: 'Another unmerge cells name'
}
}
}
},
keyboard: {
bindings: QuillBetterTable.keyboardBindings
}
}
}
);
}
ngAfterViewInit() { }

onInsertTable() {
const tableModule = this.quill.getModule('better-table');
tableModule.insertTable(3, 3);
}
}
`

Untitled

its showing me above error if quill not installed and after installing quill with npm, code is working fine but only inserting <p> tag (paragraph tag) multiple times.

commented

image

I'm working in React JS apps, <p> tags are adding instead of table. I tired exposing quill js file in index.html file. but still facing same issue. Can I get help in resolving this issue