From 8fc5e03758fc5976941e8e043ee451248eff1797 Mon Sep 17 00:00:00 2001 From: polv Date: Tue, 3 Feb 2026 12:58:31 +0700 Subject: [PATCH] move img.title generator to Video component --- docs/.vitepress/config.mts | 15 --------- docs/.vitepress/theme/components/Video.vue | 36 +++++++++++----------- 2 files changed, 18 insertions(+), 33 deletions(-) diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index fbc03261..23095ea4 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -30,21 +30,6 @@ export default defineConfig({ image: { lazyLoading: true, }, - config(md) { - md.renderer.rules.image = function (tokens, idx, options, env, slf) { - const token = tokens[idx]; - - // Get the alt if it exists - const alt = token.attrGet('alt') || token.content || ''; - - // Fill the title attribute with the alt if it exists - if (!token.attrGet('title')) { - token.attrSet('title', alt); - } - - return slf.renderToken(tokens, idx, options) - } - } }, vite: { clearScreen: false, diff --git a/docs/.vitepress/theme/components/Video.vue b/docs/.vitepress/theme/components/Video.vue index 5e8e6ae5..77d5f8c3 100644 --- a/docs/.vitepress/theme/components/Video.vue +++ b/docs/.vitepress/theme/components/Video.vue @@ -1,41 +1,41 @@ \ No newline at end of file +