prosemirror-markdown/alpha/MarkdownView.ts

19 lines
350 B
TypeScript

export class MarkdownView {
textarea: any;
constructor(target: any, content: any) {
this.textarea = target.appendChild(document.createElement('textarea'));
this.textarea.value = content;
}
get content() {
return this.textarea.value;
}
focus() {
this.textarea.focus();
}
destroy() {
this.textarea.remove();
}
}