diff --git a/client/components/editor.vue b/client/components/editor.vue index 0a6c61e3..15311e9b 100644 --- a/client/components/editor.vue +++ b/client/components/editor.vue @@ -44,7 +44,7 @@ v-icon(color='red', :left='$vuetify.breakpoint.lgAndUp') mdi-close span.white--text(v-if='$vuetify.breakpoint.lgAndUp') {{ $t('common:actions.close') }} v-divider.ml-3(vertical) - v-content + v-main component(:is='currentEditor', :save='save') editor-modal-properties(v-model='dialogProps') editor-modal-editorselect(v-model='dialogEditorSelector') diff --git a/client/components/editor/editor-markdown.vue b/client/components/editor/editor-markdown.vue index 895e0bd8..286fad7f 100644 --- a/client/components/editor/editor-markdown.vue +++ b/client/components/editor/editor-markdown.vue @@ -272,7 +272,9 @@ const md = new MarkdownIt({ linkify: true, typography: true, highlight(str, lang) { - if (['mermaid', 'plantuml'].includes(lang)) { + if (lang === 'diagram') { + return `
` + Buffer.from(str, 'base64').toString() + `` + } else if (['mermaid', 'plantuml'].includes(lang)) { return `
${_.escape(str)}
`
} else {
return `${_.escape(str)}
`
@@ -766,6 +768,11 @@ export default {
content: `[${opts.text}](${opts.path})`
})
break
+ case 'DIAGRAM':
+ this.insertAtCursor({
+ content: '```diagram\n' + opts.text + '\n```'
+ })
+ break
}
})
diff --git a/client/components/editor/editor-modal-drawio.vue b/client/components/editor/editor-modal-drawio.vue
index aafae1cd..d05319d2 100644
--- a/client/components/editor/editor-modal-drawio.vue
+++ b/client/components/editor/editor-modal-drawio.vue
@@ -2,7 +2,7 @@
v-card.editor-modal-drawio.animated.fadeIn(flat, tile)
iframe(
ref='drawio'
- src='https://embed.diagrams.net/?embed=1&proto=json&spin=1&saveAndExit=0'
+ src='https://embed.diagrams.net/?embed=1&proto=json&spin=1&saveAndExit=1&noSaveBtn=1&noExitBtn=0'
frameborder='0'
)
@@ -11,7 +11,7 @@
import { sync, get } from 'vuex-pathify'
const xmlTest = `
-