mirror of
https://github.com/linsa-io/linsa.git
synced 2026-01-12 12:20:23 +01:00
* chore: remove sliding menu * feat(ui): sheet * feat: shortcut component * chore: register new shortcut component to layout * fix: react attr naming * fix: set default to false for shortcut * feat(store): keydown-manager * feat(hooks): keyboard manager * chore: use util from base for la-editor * chore: use util from base for minimal-tiptap-editor * chore(utils): keyboard * chore: use new keyboard manager * fix: uniqueness of certain component * feat: global key handler * chore: implement new key handler
15 lines
348 B
TypeScript
15 lines
348 B
TypeScript
import type { Editor } from "@tiptap/core"
|
|
import type { MinimalTiptapProps } from "./minimal-tiptap"
|
|
|
|
export function getOutput(editor: Editor, format: MinimalTiptapProps["output"]) {
|
|
if (format === "json") {
|
|
return editor.getJSON()
|
|
}
|
|
|
|
if (format === "html") {
|
|
return editor.getText() ? editor.getHTML() : ""
|
|
}
|
|
|
|
return editor.getText()
|
|
}
|