From b21df879c68229ca448f04f5c36ca5937bda2870 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=A4fer?= Date: Tue, 16 Apr 2019 01:05:51 +0200 Subject: [PATCH] Fix lint --- webapp/components/Editor/index.vue | 4 +-- webapp/components/Editor/nodes/Mention.js | 31 +++++++++++++---------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/webapp/components/Editor/index.vue b/webapp/components/Editor/index.vue index 84306736d..270c20840 100644 --- a/webapp/components/Editor/index.vue +++ b/webapp/components/Editor/index.vue @@ -184,7 +184,7 @@ import { Strike, Underline, Link, - History, + History } from 'tiptap-extensions' import Mention from './nodes/Mention.js' @@ -535,7 +535,7 @@ li > p { .editor { .mention-suggestion { - color: $color-primary + color: $color-primary; } &__floating-menu { position: absolute; diff --git a/webapp/components/Editor/nodes/Mention.js b/webapp/components/Editor/nodes/Mention.js index 1f459df76..f86f20bd9 100644 --- a/webapp/components/Editor/nodes/Mention.js +++ b/webapp/components/Editor/nodes/Mention.js @@ -4,22 +4,25 @@ import { Mention as TipTapMention } from 'tiptap-extensions' export default class Mention extends TipTapMention { get schema() { - const schema = super.schema - schema.attrs = { + const patchedSchema = super.schema + + patchedSchema.attrs = { url: {}, - label: {}, - }, - schema.toDOM = node => [ - 'a', - { - class: this.options.mentionClass, - href: node.attrs.url, - }, - `${this.options.matcher.char}${node.attrs.label}` - ] - schema.parseDOM = [ + label: {} + } + patchedSchema.toDOM = node => { + return [ + 'a', + { + class: this.options.mentionClass, + href: node.attrs.url + }, + `${this.options.matcher.char}${node.attrs.label}` + ] + } + patchedSchema.parseDOM = [ // this is not implemented ] - return schema + return patchedSchema } }