feat: support more syntaxes in editor
parent
2b7e1dbfc0
commit
da64d008a1
|
@ -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),
|
||||||
|
|
|
@ -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,
|
||||||
|
|
Loading…
Reference in New Issue