feat: support more syntaxes in editor

This commit is contained in:
三咲智子 2022-11-26 10:01:50 +08:00
parent 2b7e1dbfc0
commit da64d008a1
No known key found for this signature in database
GPG key ID: 69992F2250DFD93E
2 changed files with 9 additions and 1 deletions

View file

@ -37,7 +37,7 @@ export function getDefaultDraft({
} }
} }
export function getParamsFromStatus(status: Status) { export function getParamsFromStatus(status: Status): Draft['params'] {
return { return {
status: status.content, status: status.content,
mediaIds: status.mediaAttachments.map(att => att.id), mediaIds: status.mediaAttachments.map(att => att.id),

View file

@ -6,6 +6,10 @@ import Text from '@tiptap/extension-text'
import Mention from '@tiptap/extension-mention' import Mention from '@tiptap/extension-mention'
import CodeBlock from '@tiptap/extension-code-block' import CodeBlock from '@tiptap/extension-code-block'
import CharacterCount from '@tiptap/extension-character-count' import CharacterCount from '@tiptap/extension-character-count'
import HardBreak from '@tiptap/extension-hard-break'
import Bold from '@tiptap/extension-bold'
import Italic from '@tiptap/extension-italic'
import Code from '@tiptap/extension-code'
import { Plugin } from 'prosemirror-state' import { Plugin } from 'prosemirror-state'
import type { Ref } from 'vue' import type { Ref } from 'vue'
@ -32,6 +36,10 @@ export function useTiptap(options: UseTiptapOptions) {
extensions: [ extensions: [
Document, Document,
Paragraph, Paragraph,
HardBreak,
Bold,
Italic,
Code,
Text, Text,
Mention.configure({ Mention.configure({
suggestion: MentionSuggestion, suggestion: MentionSuggestion,