prosemirror-markdown/alpha/MarkdownView.ts

19 lines
350 B
TypeScript
Raw Permalink Normal View History

2022-06-07 11:25:34 +02:00
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();
}
}