From 7bf2c9727305c75c826d65ab609c004f7ce3cda2 Mon Sep 17 00:00:00 2001 From: Kaustubh Maske Patil <37668193+nikochiko@users.noreply.github.com> Date: Wed, 4 Dec 2024 17:27:14 +0530 Subject: [PATCH] convert markdown->plaintext for meta description --- daras_ai_v2/meta_content.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/daras_ai_v2/meta_content.py b/daras_ai_v2/meta_content.py index db8faeea6..faa0e55ec 100644 --- a/daras_ai_v2/meta_content.py +++ b/daras_ai_v2/meta_content.py @@ -1,8 +1,11 @@ import typing +from markdown_it import MarkdownIt + from bots.models import PublishedRun, SavedRun, WorkflowMetadata from daras_ai_v2.breadcrumbs import get_title_breadcrumbs from daras_ai_v2.meta_preview_url import meta_preview_url +from daras_ai_v2.tts_markdown_renderer import RendererPlain if typing.TYPE_CHECKING: from routers.root import RecipeTabs @@ -158,6 +161,7 @@ def meta_description_for_page( else: description = metadata.meta_description + description = MarkdownIt(renderer_cls=RendererPlain).render(description) if not (pr and pr.is_root()) or not description: # for all non-root examples, or when there is no other description description += SEP + "AI API, workflow & prompt shared on Gooey.AI."