From 4725b8cbd256a6043ac7dafbdc25e170206a60ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 19 Jun 2019 09:12:26 +0200 Subject: [PATCH] Got Tags as `#` in the editor as an extension to work --- webapp/components/Editor/index.vue | 3 +++ webapp/components/Editor/nodes/Mention.js | 10 +++++++--- webapp/components/Editor/nodes/Tag.js | 10 +++++++--- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/webapp/components/Editor/index.vue b/webapp/components/Editor/index.vue index 6307ff5ee..d8fd45697 100644 --- a/webapp/components/Editor/index.vue +++ b/webapp/components/Editor/index.vue @@ -625,6 +625,9 @@ li > p { .mention-suggestion { color: $color-primary; } + .tag-suggestion { + color: $color-primary; + } &__floating-menu { position: absolute; margin-top: -0.25rem; diff --git a/webapp/components/Editor/nodes/Mention.js b/webapp/components/Editor/nodes/Mention.js index 710ac13fd..c48b74286 100644 --- a/webapp/components/Editor/nodes/Mention.js +++ b/webapp/components/Editor/nodes/Mention.js @@ -1,6 +1,10 @@ import { Mention as TipTapMention } from 'tiptap-extensions' export default class Mention extends TipTapMention { + get name() { + return 'mention' + } + get schema() { const patchedSchema = super.schema @@ -19,9 +23,9 @@ export default class Mention extends TipTapMention { `${this.options.matcher.char}${node.attrs.label}`, ] } - // patchedSchema.parseDOM = [ - // // this is not implemented - // ] + patchedSchema.parseDOM = [ + // this is not implemented + ] return patchedSchema } } diff --git a/webapp/components/Editor/nodes/Tag.js b/webapp/components/Editor/nodes/Tag.js index f3fdd75e9..0a7324c81 100644 --- a/webapp/components/Editor/nodes/Tag.js +++ b/webapp/components/Editor/nodes/Tag.js @@ -1,6 +1,10 @@ import { Mention as TipTapMention } from 'tiptap-extensions' export default class Tag extends TipTapMention { + get name() { + return 'tag' + } + get defaultOptions() { return { matcher: { @@ -31,9 +35,9 @@ export default class Tag extends TipTapMention { `${this.options.matcher.char}${node.attrs.label}`, ] } - // patchedSchema.parseDOM = [ - // // this is not implemented - // ] + patchedSchema.parseDOM = [ + // this is not implemented + ] return patchedSchema } }