send links to the LLM as markdown so drafts keep real hyperlinks

Transcripts flattened links to "text ( url )", so the model copied that shape and drafts came back with the URL in brackets instead of a link. HTML to text for the LLM now writes "[text](url)", which Markdown2HTML turns back into an anchor.
This commit is contained in:
Abhinav Raut
2026-07-31 18:02:22 +05:30
parent da378e7615
commit 2e89586a11
8 changed files with 98 additions and 16 deletions
-5
View File
@@ -48,11 +48,6 @@ func HTML2Text(html string) string {
return htmlToText(html, html2text.Options{TextOnly: true})
}
// HTML2TextWithLinks converts HTML to text keeping link URLs as "text ( url )".
func HTML2TextWithLinks(html string) string {
return htmlToText(html, html2text.Options{})
}
// Markdown2HTML converts markdown to HTML, falling back to the input on error.
func Markdown2HTML(md string) string {
var b strings.Builder