diff --git a/components/help/HelpPreview.vue b/components/help/HelpPreview.vue
index 90cc4e58..8e37f4f6 100644
--- a/components/help/HelpPreview.vue
+++ b/components/help/HelpPreview.vue
@@ -30,7 +30,7 @@ const emit = defineEmits<{
{{ $t('help.desc_para3') }}
-
+
diff --git a/components/publish/PublishAttachment.vue b/components/publish/PublishAttachment.vue
index fa29a2e7..3e1a29ec 100644
--- a/components/publish/PublishAttachment.vue
+++ b/components/publish/PublishAttachment.vue
@@ -34,7 +34,7 @@ const toggleApply = () => {
text-white px2 py2 rounded-full cursor-pointer
@click="$emit('remove')"
>
-
+
diff --git a/components/publish/PublishLanguagePicker.vue b/components/publish/PublishLanguagePicker.vue
index bd7f139b..6e58d524 100644
--- a/components/publish/PublishLanguagePicker.vue
+++ b/components/publish/PublishLanguagePicker.vue
@@ -1,5 +1,4 @@
-
-
+
+
+
+
{
let length = stringLength(htmlToText(editor.value?.getHTML() || ''))
@@ -76,6 +77,8 @@ const characterCount = $computed(() => {
return length
})
+const postLanguageDisplay = $computed(() => languagesNameList.find(i => i.code === (draft.params.language || preferredLanguage))?.nativeName)
+
async function handlePaste(evt: ClipboardEvent) {
const files = evt.clipboardData?.files
if (!files || files.length === 0)
@@ -147,7 +150,7 @@ defineExpose({
>
- {{ acctToShortHandle(m) }}
+ {{ accountToShortHandle(m) }}
@@ -278,6 +281,20 @@ defineExpose({
{{ characterCount ?? 0 }}/ {{ characterLimit }}
+
+
+
+ {{ postLanguageDisplay }}
+
+
+
+
+
+
+
+
+
+
@@ -285,19 +302,6 @@ defineExpose({
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/components/user/UserPicker.vue b/components/user/UserPicker.vue
index 23ea40ae..f3c3d486 100644
--- a/components/user/UserPicker.vue
+++ b/components/user/UserPicker.vue
@@ -5,7 +5,7 @@ const all = useUsers()
const router = useRouter()
const clickUser = (user: UserLogin) => {
- if (user.account.id === currentUser.value?.account.id)
+ if (user.account.acct === currentUser.value?.account.acct)
router.push(getAccountRoute(user.account))
else
switchUser(user)
@@ -21,7 +21,7 @@ const clickUser = (user: UserLogin) => {
flex rounded
cursor-pointer
aria-label="Switch user"
- :class="user.account.id === currentUser?.account.id ? '' : 'op25 grayscale'"
+ :class="user.account.acct === currentUser?.account.acct ? '' : 'op25 grayscale'"
hover="filter-none op100"
@click="clickUser(user)"
>
diff --git a/components/user/UserSwitcher.vue b/components/user/UserSwitcher.vue
index 21774835..e8a766f1 100644
--- a/components/user/UserSwitcher.vue
+++ b/components/user/UserSwitcher.vue
@@ -51,7 +51,7 @@ const clickUser = (user: UserLogin) => {
:text="$t('user.sign_out_account', [getFullHandle(currentUser.account)])"
icon="i-ri:logout-box-line rtl-flip"
w-full
- @click="signout"
+ @click="signOut"
/>
diff --git a/composables/about.ts b/composables/about.ts
index 89d9df79..d793c76f 100644
--- a/composables/about.ts
+++ b/composables/about.ts
@@ -7,7 +7,7 @@ export interface Team {
mastodon: string
}
-export const teams: Team[] = [
+export const elkTeamMembers: Team[] = [
{
github: 'antfu',
display: 'Anthony Fu',
diff --git a/composables/command.ts b/composables/command.ts
index 6c19171b..da2c5a26 100644
--- a/composables/command.ts
+++ b/composables/command.ts
@@ -349,7 +349,7 @@ export const provideGlobalCommands = () => {
icon: 'i-ri:logout-box-line',
onActivate() {
- signout()
+ signOut()
},
})
}
diff --git a/composables/content-render.ts b/composables/content-render.ts
index 26d35073..3d736f84 100644
--- a/composables/content-render.ts
+++ b/composables/content-render.ts
@@ -21,7 +21,7 @@ export function contentToVNode(
return h(Fragment, (tree.children as Node[] || []).map(n => treeToVNode(n)))
}
-export function nodeToVNode(node: Node): VNode | string | null {
+function nodeToVNode(node: Node): VNode | string | null {
if (node.type === TEXT_NODE)
return node.value
diff --git a/composables/langugage.ts b/composables/langugage.ts
new file mode 100644
index 00000000..2584afc8
--- /dev/null
+++ b/composables/langugage.ts
@@ -0,0 +1,11 @@
+import ISO6391 from 'iso-639-1'
+
+export const languagesNameList: {
+ code: string
+ nativeName: string
+ name: string
+}[] = ISO6391.getAllCodes().map(code => ({
+ code,
+ nativeName: ISO6391.getNativeName(code),
+ name: ISO6391.getName(code),
+}))
diff --git a/composables/masto/account.ts b/composables/masto/account.ts
index b97c4ba1..a1041ca3 100644
--- a/composables/masto/account.ts
+++ b/composables/masto/account.ts
@@ -7,14 +7,14 @@ export function getDisplayName(account: mastodon.v1.Account, options?: { rich?:
return displayName.replace(/:([\w-]+?):/g, '')
}
-export function acctToShortHandle(acct: string) {
+export function accountToShortHandle(acct: string) {
return `@${acct.includes('@') ? acct.split('@')[0] : acct}`
}
export function getShortHandle({ acct }: mastodon.v1.Account) {
if (!acct)
return ''
- return acctToShortHandle(acct)
+ return accountToShortHandle(acct)
}
export function getServerName(account: mastodon.v1.Account) {
diff --git a/composables/masto/masto.ts b/composables/masto/masto.ts
index c9726830..d64addaa 100644
--- a/composables/masto/masto.ts
+++ b/composables/masto/masto.ts
@@ -47,7 +47,7 @@ export function mastoLogin(masto: ElkMasto, user: Pick
isUploading: Ref
initialDraft: Ref<() => Draft>
-}) => {
+}) {
const { expanded, isUploading, initialDraft } = $(options)
let { draft, isEmpty } = $(options.draftState)
const { client } = $(useMasto())
+ const settings = useUserSettings()
+
+ const preferredLanguage = $computed(() => (settings.value?.language || 'en').split('-')[0])
let isSending = $ref(false)
const isExpanded = $ref(false)
@@ -31,6 +34,7 @@ export const usePublish = (options: {
async function publishDraft() {
if (isPublishDisabled)
return
+
let content = htmlToText(draft.params.status || '')
if (draft.mentions?.length)
content = `${draft.mentions.map(i => `@${i}`).join(' ')} ${content}`
@@ -39,11 +43,12 @@ export const usePublish = (options: {
...draft.params,
status: content,
mediaIds: draft.attachments.map(a => a.id),
+ language: draft.params.language || preferredLanguage,
...(isGlitchEdition.value ? { 'content-type': 'text/markdown' } : {}),
} as mastodon.v1.CreateStatusParams
if (process.dev) {
- // eslint-disable-next-line no-console
+ // eslint-disable-next-line no-console
console.info({
raw: draft.params.status,
...payload,
@@ -60,6 +65,7 @@ export const usePublish = (options: {
let status: mastodon.v1.Status
if (!draft.editingStatus)
status = await client.v1.statuses.create(payload)
+
else
status = await client.v1.statuses.update(draft.editingStatus.id, payload)
if (draft.params.inReplyToId)
@@ -84,14 +90,14 @@ export const usePublish = (options: {
shouldExpanded,
isPublishDisabled,
failedMessages,
-
+ preferredLanguage,
publishDraft,
})
}
export type MediaAttachmentUploadError = [filename: string, message: string]
-export const useUploadMediaAttachment = (draftRef: Ref) => {
+export function useUploadMediaAttachment(draftRef: Ref) {
const draft = $(draftRef)
const { client } = $(useMasto())
const { t } = useI18n()
@@ -117,7 +123,7 @@ export const useUploadMediaAttachment = (draftRef: Ref) => {
draft.attachments.push(attachment)
}
catch (e) {
- // TODO: add some human-readable error message, problem is that masto api will not return response code
+ // TODO: add some human-readable error message, problem is that masto api will not return response code
console.error(e)
failedAttachments = [...failedAttachments, [file.name, (e as Error).message]]
}
@@ -159,9 +165,10 @@ export const useUploadMediaAttachment = (draftRef: Ref) => {
return $$({
isUploading,
isExceedingAttachmentLimit,
+ isOverDropZone,
+
failedAttachments,
dropZoneRef,
- isOverDropZone,
uploadAttachments,
pickAttachments,
diff --git a/composables/masto/statusDrafts.ts b/composables/masto/statusDrafts.ts
index 567eb017..94598bd4 100644
--- a/composables/masto/statusDrafts.ts
+++ b/composables/masto/statusDrafts.ts
@@ -33,7 +33,7 @@ export function getDefaultDraft(options: Partial()
diff --git a/composables/screen.ts b/composables/screen.ts
index db0c2b2f..62406e56 100644
--- a/composables/screen.ts
+++ b/composables/screen.ts
@@ -2,6 +2,4 @@ import { breakpointsTailwind } from '@vueuse/core'
export const breakpoints = useBreakpoints(breakpointsTailwind)
-export const isSmallScreen = breakpoints.smallerOrEqual('md')
-export const isMediumScreen = breakpoints.smallerOrEqual('lg')
export const isMediumOrLargeScreen = breakpoints.between('sm', 'xl')
diff --git a/composables/users.ts b/composables/users.ts
index f5925e7a..062fa401 100644
--- a/composables/users.ts
+++ b/composables/users.ts
@@ -7,7 +7,6 @@ import type { UserLogin } from '~/types'
import type { Overwrite } from '~/types/utils'
import {
DEFAULT_POST_CHARS_LIMIT,
- STORAGE_KEY_CURRENT_USER,
STORAGE_KEY_CURRENT_USER_HANDLE,
STORAGE_KEY_NODES,
STORAGE_KEY_NOTIFICATION,
@@ -44,20 +43,20 @@ const initializeUsers = async (): Promise[ | RemovableRef]>(STORAGE_KEY_SERVERS, mock ? mock.server : {}, { deep: true })
-export const nodes = useLocalStorage>(STORAGE_KEY_NODES, {}, { deep: true })
-const currentUserId = useLocalStorage(STORAGE_KEY_CURRENT_USER, mock ? mock.user.account.id : '')
+const nodes = useLocalStorage>(STORAGE_KEY_NODES, {}, { deep: true })
+const currentUserHandle = useLocalStorage(STORAGE_KEY_CURRENT_USER_HANDLE, mock ? mock.user.account.id : '')
+export const instanceStorage = useLocalStorage>(STORAGE_KEY_SERVERS, mock ? mock.server : {}, { deep: true })
export type ElkInstance = Partial & {
uri: string
/** support GoToSocial */
accountDomain?: string | null
}
-export const getInstanceCache = (server: string): mastodon.v1.Instance | undefined => instances.value[server]
+export const getInstanceCache = (server: string): mastodon.v1.Instance | undefined => instanceStorage.value[server]
export const currentUser = computed(() => {
- if (currentUserId.value) {
- const user = users.value.find(user => user.account?.id === currentUserId.value)
+ if (currentUserHandle.value) {
+ const user = users.value.find(user => user.account?.acct === currentUserHandle.value)
if (user)
return user
}
@@ -66,7 +65,7 @@ export const currentUser = computed(() => {
})
const publicInstance = ref(null)
-export const currentInstance = computed(() => currentUser.value ? instances.value[currentUser.value.server] ?? null : publicInstance.value)
+export const currentInstance = computed(() => currentUser.value ? instanceStorage.value[currentUser.value.server] ?? null : publicInstance.value)
export function getInstanceDomain(instance: ElkInstance) {
return instance.accountDomain || withoutProtocol(instance.uri)
@@ -84,12 +83,12 @@ if (process.client) {
const windowReload = () => {
document.visibilityState === 'visible' && window.location.reload()
}
- watch(currentUserId, async (id, oldId) => {
+ watch(currentUserHandle, async (handle, oldHandle) => {
// when sign in or switch account
- if (id) {
- if (id === currentUser.value?.account?.id) {
+ if (handle) {
+ if (handle === currentUser.value?.account?.acct) {
// when sign in, the other tab will not have the user, idb is not reactive
- const newUser = users.value.find(user => user.account?.id === id)
+ const newUser = users.value.find(user => user.account?.acct === handle)
// if the user is there, then we are switching account
if (newUser) {
// check if the change is on current tab: if so, don't reload
@@ -101,19 +100,13 @@ if (process.client) {
window.addEventListener('visibilitychange', windowReload, { capture: true })
}
// when sign out
- else if (oldId) {
- const oldUser = users.value.find(user => user.account?.id === oldId)
+ else if (oldHandle) {
+ const oldUser = users.value.find(user => user.account?.acct === oldHandle)
// when sign out, the other tab will not have the user, idb is not reactive
if (oldUser)
window.addEventListener('visibilitychange', windowReload, { capture: true })
}
}, { immediate: true, flush: 'post' })
-
- // for injected script to read
- const currentUserHandle = computed(() => currentUser.value?.account.acct || '')
- watchEffect(() => {
- localStorage.setItem(STORAGE_KEY_CURRENT_USER_HANDLE, currentUserHandle.value)
- })
}
export const useUsers = () => users
@@ -144,7 +137,7 @@ export async function loginTo(masto: ElkMasto, user: Overwrite u.server === currentUser.value!.server && i !== index))
- delete instances.value[currentUser.value.server]
+ delete instanceStorage.value[currentUser.value.server]
await removePushNotifications(currentUser.value)
await removePushNotificationData(currentUser.value)
- currentUserId.value = ''
+ currentUserHandle.value = ''
// Remove the current user from the users
users.value.splice(index, 1)
}
// Set currentUserId to next user if available
- currentUserId.value = users.value[0]?.account?.id
+ currentUserHandle.value = users.value[0]?.account?.acct
- if (!currentUserId.value)
+ if (!currentUserHandle.value)
await useRouter().push('/')
loginTo(masto, currentUser.value)
diff --git a/constants/index.ts b/constants/index.ts
index c5c1d39d..366946d0 100644
--- a/constants/index.ts
+++ b/constants/index.ts
@@ -7,7 +7,6 @@ export const STORAGE_KEY_DRAFTS = 'elk-drafts'
export const STORAGE_KEY_USERS = 'elk-users'
export const STORAGE_KEY_SERVERS = 'elk-servers'
export const STORAGE_KEY_NODES = 'elk-nodes'
-export const STORAGE_KEY_CURRENT_USER = 'elk-current-user'
export const STORAGE_KEY_CURRENT_USER_HANDLE = 'elk-current-user-handle'
export const STORAGE_KEY_NOTIFY_TAB = 'elk-notify-tab'
export const STORAGE_KEY_FIRST_VISIT = 'elk-first-visit'
diff --git a/modules/tauri/index.ts b/modules/tauri/index.ts
index 5c0fec95..9d445922 100644
--- a/modules/tauri/index.ts
+++ b/modules/tauri/index.ts
@@ -22,6 +22,7 @@ export default defineNuxtModule({
...nuxt.options.alias,
'unstorage/drivers/fs': 'unenv/runtime/mock/proxy',
'unstorage/drivers/cloudflare-kv-http': 'unenv/runtime/mock/proxy',
+ '#storage-config': resolve('./runtime/storage-config'),
'node:events': 'unenv/runtime/node/events/index',
'#build-info': resolve('./runtime/build-info'),
}
diff --git a/modules/tauri/runtime/storage-config.ts b/modules/tauri/runtime/storage-config.ts
new file mode 100644
index 00000000..2f1ae291
--- /dev/null
+++ b/modules/tauri/runtime/storage-config.ts
@@ -0,0 +1,2 @@
+export const driver = undefined
+export const fsBase = ''
diff --git a/nuxt.config.ts b/nuxt.config.ts
index e0bd7c8d..266601be 100644
--- a/nuxt.config.ts
+++ b/nuxt.config.ts
@@ -1,4 +1,4 @@
-import { createResolver } from '@nuxt/kit'
+import { createResolver, useNuxt } from '@nuxt/kit'
import Inspect from 'vite-plugin-inspect'
import { isCI, isDevelopment, isWindows } from 'std-env'
import { isPreview } from './config/env'
@@ -86,6 +86,11 @@ export default defineNuxtConfig({
'postcss-nested': {},
},
},
+ appConfig: {
+ storage: {
+ driver: process.env.NUXT_STORAGE_DRIVER ?? (isCI ? 'cloudflare' : 'fs'),
+ },
+ },
runtimeConfig: {
adminKey: '',
cloudflare: {
@@ -102,8 +107,7 @@ export default defineNuxtConfig({
defaultServer: 'm.webtoo.ls',
},
storage: {
- driver: isCI ? 'cloudflare' : 'fs',
- fsBase: 'node_modules/.cache/servers',
+ fsBase: 'node_modules/.cache/app',
},
},
routeRules: {
@@ -126,6 +130,13 @@ export default defineNuxtConfig({
ignore: ['/settings'],
},
},
+ hooks: {
+ 'nitro:config': function (config) {
+ const nuxt = useNuxt()
+ config.virtual = config.virtual || {}
+ config.virtual['#storage-config'] = `export const driver = ${JSON.stringify(nuxt.options.appConfig.storage.driver)}`
+ },
+ },
app: {
keepalive: true,
head: {
diff --git a/package.json b/package.json
index 780d5390..1e17a63e 100644
--- a/package.json
+++ b/package.json
@@ -118,7 +118,7 @@
"unplugin-vue-inspector": "^0.0.2",
"vite-plugin-inspect": "^0.7.14",
"vite-plugin-pwa": "^0.14.1",
- "vitest": "^0.28.1",
+ "vitest": "^0.28.3",
"vue-tsc": "^1.0.24",
"workbox-build": "^6.5.4",
"workbox-window": "^6.5.4"
diff --git a/pages/settings/about/index.vue b/pages/settings/about/index.vue
index 7524d7d2..8a8ade13 100644
--- a/pages/settings/about/index.vue
+++ b/pages/settings/about/index.vue
@@ -115,7 +115,7 @@ const handleShowCommit = () => {
{
+ await Promise.all(elkTeamMembers.reduce((acc, { github }) => {
acc.push(...sizes.map(s => download(`https://github.com/${github}.png?size=${s}`, join(avatarsDir, `${github}-${s}x${s}.png`))))
return acc
}, [] as Promise[]))
diff --git a/server/shared.ts b/server/shared.ts
index 37f4b2bd..5a0d97e5 100644
--- a/server/shared.ts
+++ b/server/shared.ts
@@ -14,29 +14,31 @@ import cached from './cache-driver'
// @ts-expect-error virtual import
import { env } from '#build-info'
+// @ts-expect-error virtual import
+import { driver } from '#storage-config'
import type { AppInfo } from '~/types'
import { APP_NAME } from '~/constants'
-const config = useRuntimeConfig()
-
const fs = _fs as typeof import('unstorage/dist/drivers/fs')['default']
const kv = _kv as typeof import('unstorage/dist/drivers/cloudflare-kv-http')['default']
const memory = _memory as typeof import('unstorage/dist/drivers/memory')['default']
const storage = useStorage() as Storage
-if (config.storage.driver === 'fs') {
+if (driver === 'fs') {
+ const config = useRuntimeConfig()
storage.mount('servers', fs({ base: config.storage.fsBase }))
}
-else if (config.storage.driver === 'cloudflare') {
+else if (driver === 'cloudflare') {
+ const config = useRuntimeConfig()
storage.mount('servers', cached(kv({
accountId: config.cloudflare.accountId,
namespaceId: config.cloudflare.namespaceId,
apiToken: config.cloudflare.apiToken,
})))
}
-else if (config.storage.driver === 'memory') {
+else if (driver === 'memory') {
storage.mount('servers', memory())
}
diff --git a/tests/__snapshots__/content-rich.test.ts.snap b/tests/__snapshots__/content-rich.test.ts.snap
deleted file mode 100644
index 289bfb73..00000000
--- a/tests/__snapshots__/content-rich.test.ts.snap
+++ /dev/null
@@ -1,164 +0,0 @@
-// Vitest Snapshot v1
-
-exports[`content-rich > block with backticks 1`] = `"
[(\`number string) (\`tag string)] "`;
-
-exports[`content-rich > block with injected html, with a known language 1`] = `
-"
-
- <a href="javascript:alert(1)">click me</a>
-
-
-"
-`;
-
-exports[`content-rich > block with injected html, with an unknown language 1`] = `
-"
-
- <a href="javascript:alert(1)">click me</a>
-
-
-"
-`;
-
-exports[`content-rich > block with injected html, without language 1`] = `
-"
-
- <a href="javascript:alert(1)">click me</a>
-
-
-"
-`;
-
-exports[`content-rich > code frame 1`] = `
-"Testing code block
import { useMouse, usePreferredDark } from '@vueuse/core'
-// tracks mouse position
-const { x, y } = useMouse()
-// is the user prefers dark theme
-const isDark = usePreferredDark() "
-`;
-
-exports[`content-rich > code frame 2 1`] = `
-"
-
- Testing
-
const a = hello
-
-"
-`;
-
-exports[`content-rich > code frame empty 1`] = `"
"`;
-
-exports[`content-rich > code frame no lang 1`] = `"
hello world no lang"`;
-
-exports[`content-rich > custom emoji 1`] = `
-"Daniel Roe
-
-
-"
-`;
-
-exports[`content-rich > empty 1`] = `""`;
-
-exports[`content-rich > group mention > html 1`] = `
-"
-
-
-"
-`;
-
-exports[`content-rich > handles formatting from servers 1`] = `
-"Fedi HTML Support Survey
-Does the following formatting come through accurately for you?
-
-
- This is an indented bulleted list (not just asterisks).
- This line is bold.
- This line is italic.
-
-
- This list...
- ...is numbered and indented
-
-This line is larger.
-"
-`;
-
-exports[`content-rich > handles html within code blocks 1`] = `
-"
- HTML block code:
-
-<span class="icon--noto icon--noto--1st-place-medal"></span>
-<span class="icon--noto icon--noto--2nd-place-medal-medal"></span>
-
-"
-`;
-
-exports[`content-rich > inline code with link 1`] = `
-"
- Inline code with link:
- https://api.iconify.design/noto.css?icons=1st-place-medal,2nd-place-medal
-
-"
-`;
-
-exports[`content-rich > link + mention 1`] = `
-"
- Happy
-
- weβre now using
-
- (migrated from chai+mocha)
- https:// github.com/ayoayco/astro-react ive-library/pull/203
-
-"
-`;
-
-exports[`content-rich > plain text 1`] = `
-"hello there
-"
-`;
-
-exports[`editor > transform mentions 1`] = `
-"
-@elk Hello"
-`;
diff --git a/tests/__snapshots__/html-parse.test.ts.snap b/tests/__snapshots__/html-parse.test.ts.snap
deleted file mode 100644
index d7f36a0d..00000000
--- a/tests/__snapshots__/html-parse.test.ts.snap
+++ /dev/null
@@ -1,144 +0,0 @@
-// Vitest Snapshot v1
-
-exports[`html-parse > code frame > html 1`] = `
-"Testing code block
import { useMouse, usePreferredDark } from '@vueuse/core'
-// tracks mouse position
-const { x, y } = useMouse()
-// is the user prefers dark theme
-const isDark = usePreferredDark()
"
-`;
-
-exports[`html-parse > code frame > text 1`] = `
-"Testing code block
-
-
-\`\`\`ts
-import { useMouse, usePreferredDark } from '@vueuse/core'
-// tracks mouse position
-const { x, y } = useMouse()
-// is the user prefers dark theme
-const isDark = usePreferredDark()
-\`\`\`"
-`;
-
-exports[`html-parse > code frame 2 > html 1`] = `
-"
- @antfu
- Testing
-
const a = hello
-
-"
-`;
-
-exports[`html-parse > code frame 2 > text 1`] = `
-"@antfu Testing
-
-\`\`\`ts
-const a = hello
-\`\`\`"
-`;
-
-exports[`html-parse > custom emoji > html 1`] = `
-"Daniel Roe
-
-
-"
-`;
-
-exports[`html-parse > custom emoji > text 1`] = `"Daniel Roe :nuxt:"`;
-
-exports[`html-parse > emojis > html 1`] = `
-"
-
-
-"
-`;
-
-exports[`html-parse > emojis > text 1`] = `"π«π· π¨βπ©βπ¦ π©βππ§π½βπ"`;
-
-exports[`html-parse > empty > html 1`] = `""`;
-
-exports[`html-parse > empty > text 1`] = `""`;
-
-exports[`html-parse > html entities > html 1`] = `
-"Hello <World />.
-"
-`;
-
-exports[`html-parse > html entities > text 1`] = `"Hello ."`;
-
-exports[`html-parse > inline markdown > html 1`] = `"text code
bold italic del
code block
"`;
-
-exports[`html-parse > inline markdown > text 1`] = `
-"text \`code\` **bold** *italic* ~~del~~
-
-
-\`\`\`js
-code block
-\`\`\`"
-`;
-
-exports[`html-parse > link + mention > html 1`] = `
-"
- Happy
-
- weβre now using
- @vitest
- (migrated from chai+mocha)
- https:// github.com/ayoayco/astro-react ive-library/pull/203
-
-"
-`;
-
-exports[`html-parse > link + mention > text 1`] = `"Happy π€ weβre now using @vitest (migrated from chai+mocha) https://github.com/ayoayco/astro-reactive-library/pull/203"`;
diff --git a/tests/nuxt/content-rich.test.ts b/tests/nuxt/content-rich.test.ts
index 9d32b592..d21bc30e 100644
--- a/tests/nuxt/content-rich.test.ts
+++ b/tests/nuxt/content-rich.test.ts
@@ -287,15 +287,10 @@ vi.mock('shiki-es', async (importOriginal) => {
}
})
-vi.mock('~/components/content/ContentMentionGroup.vue', async () => {
- const { defineComponent, h } = await import('vue')
- return {
- default: defineComponent({
- setup(props, { slots }) {
- return () => h('mention-group', null, { default: () => slots?.default?.() })
- },
- }),
- }
+mockComponent('ContentMentionGroup', {
+ setup(props, { slots }) {
+ return () => h('mention-group', null, { default: () => slots?.default?.() })
+ },
})
mockComponent('AccountHoverWrapper', {