From bc3197ba22e8cbf5410fb2e1d3ed44e9a00f8f1e Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Mon, 21 Nov 2022 05:21:53 +0800 Subject: [PATCH] feat: basic parsing of post content --- components/common/RichContent.ts | 11 +++++ components/publish/PublishWidget.vue | 7 ++- components/status/StatusBody.vue | 8 ++-- composables/content.ts | 72 ++++++++++++++++++++++++++++ package.json | 1 + pnpm-lock.yaml | 8 ++++ 6 files changed, 102 insertions(+), 5 deletions(-) create mode 100644 components/common/RichContent.ts create mode 100644 composables/content.ts diff --git a/components/common/RichContent.ts b/components/common/RichContent.ts new file mode 100644 index 00000000..c8f2018c --- /dev/null +++ b/components/common/RichContent.ts @@ -0,0 +1,11 @@ +export default defineComponent({ + props: { + content: { + type: String, + required: true, + }, + }, + setup(props) { + return () => contentToVNode(props.content) + }, +}) diff --git a/components/publish/PublishWidget.vue b/components/publish/PublishWidget.vue index d15d0ba1..9181a35b 100644 --- a/components/publish/PublishWidget.vue +++ b/components/publish/PublishWidget.vue @@ -18,7 +18,12 @@ async function publish() {