feat: basic parsing of post content
This commit is contained in:
parent
38f5d7155f
commit
bc3197ba22
6 changed files with 102 additions and 5 deletions
11
components/common/RichContent.ts
Normal file
11
components/common/RichContent.ts
Normal file
|
@ -0,0 +1,11 @@
|
|||
export default defineComponent({
|
||||
props: {
|
||||
content: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
setup(props) {
|
||||
return () => contentToVNode(props.content)
|
||||
},
|
||||
})
|
|
@ -18,7 +18,12 @@ async function publish() {
|
|||
|
||||
<template>
|
||||
<div flex flex-col gap-4 :class="isSending ? ' pointer-events-none' : ''">
|
||||
<textarea v-model="draftPost" p2 border-rounded w-full h-40 color-black placeholder="What's on your mind?" />
|
||||
<textarea
|
||||
v-model="draftPost"
|
||||
placeholder="What's on your mind?"
|
||||
p2 border-rounded w-full h-40
|
||||
bg-gray:10 outline-none border="~ border"
|
||||
/>
|
||||
<div flex justify-end>
|
||||
<button h-9 w-22 bg-primary border-rounded :disabled="draftPost === ''" @click="publish">
|
||||
Publish!
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
<script setup lang="ts">
|
||||
import type { Status } from 'masto'
|
||||
|
||||
defineProps<{
|
||||
const { status } = defineProps<{
|
||||
status: Status
|
||||
}>()
|
||||
|
||||
// TODO: parse and interop content (link, emojis)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="status-body" v-html="sanitize(status.content)" />
|
||||
<div class="status-body">
|
||||
<CommonRichContent :content="status.content" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="postcss">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue