refactoring of mermaid support WIP

This commit is contained in:
zadam
2021-09-29 22:10:15 +02:00
parent b37bcd294c
commit 896c9cec04
4 changed files with 66 additions and 7 deletions

View File

@@ -48,8 +48,7 @@ const typeWidgetClasses = {
'relation-map': RelationMapTypeWidget,
'protected-session': ProtectedSessionTypeWidget,
'book': BookTypeWidget,
'note-map': NoteMapTypeWidget,
'mermaid': MermaidTypeWidget
'note-map': NoteMapTypeWidget
};
export default class NoteDetailWidget extends NoteContextAwareWidget {
@@ -163,7 +162,7 @@ export default class NoteDetailWidget extends NoteContextAwareWidget {
type = 'read-only-text';
}
if (type === 'code' && await this.noteContext.isReadOnly()) {
if ((type === 'code' || type === 'mermaid') && await this.noteContext.isReadOnly()) {
type = 'read-only-code';
}
@@ -171,7 +170,7 @@ export default class NoteDetailWidget extends NoteContextAwareWidget {
type = 'editable-text';
}
if (type === 'code') {
if (type === 'code' || type === 'mermaid') {
type = 'editable-code';
}