mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
The bug happened because the hashtag link won't get parsed by the extension. This is desired for mentions because you don't want to re-notify a user if you haven't updated the text in which you notify somebody. For hashtags this is undesired and would lead to transforming the hashtag link into a normal link on the next edit of a post.
39 lines
837 B
Vue
39 lines
837 B
Vue
<template>
|
|
<editor-content :editor="editor" />
|
|
</template>
|
|
|
|
<script>
|
|
import defaultExtensions from './defaultExtensions.js'
|
|
import Hashtag from './nodes/Hashtag.js'
|
|
import { Editor, EditorContent } from 'tiptap'
|
|
|
|
export default {
|
|
name: 'ContentViewer',
|
|
components: {
|
|
EditorContent,
|
|
},
|
|
props: {
|
|
content: { type: String, default: '' },
|
|
doc: { type: Object, default: () => {} },
|
|
},
|
|
data() {
|
|
return {
|
|
editor: new Editor({
|
|
doc: this.doc,
|
|
content: this.content,
|
|
editable: false,
|
|
extensions: [
|
|
// Hashtags must come first, see
|
|
// https://github.com/scrumpy/tiptap/issues/421#issuecomment-523037460
|
|
new Hashtag(),
|
|
...defaultExtensions(this),
|
|
],
|
|
}),
|
|
}
|
|
},
|
|
beforeDestroy() {
|
|
this.editor.destroy()
|
|
},
|
|
}
|
|
</script>
|