From c4ae3e429cd69388d9cde11fa79a8b5d99f04f78 Mon Sep 17 00:00:00 2001 From: adamdotdevin <2363879+adamdottv@users.noreply.github.com> Date: Tue, 12 Aug 2025 13:22:19 -0500 Subject: [PATCH] fix: markdown lists --- packages/tui/internal/util/file.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/tui/internal/util/file.go b/packages/tui/internal/util/file.go index 943f784f..879e8a6a 100644 --- a/packages/tui/internal/util/file.go +++ b/packages/tui/internal/util/file.go @@ -3,6 +3,7 @@ package util import ( "fmt" "path/filepath" + "regexp" "strings" "unicode" @@ -85,7 +86,8 @@ func Extension(path string) string { func ToMarkdown(content string, width int, backgroundColor compat.AdaptiveColor) string { r := styles.GetMarkdownRenderer(width-6, backgroundColor) content = strings.ReplaceAll(content, RootPath+"/", "") - content = strings.ReplaceAll(content, "-", "\u2011") + hyphenRegex := regexp.MustCompile(`-([^ ]|$)`) + content = hyphenRegex.ReplaceAllString(content, "\u2011$1") rendered, _ := r.Render(content) lines := strings.Split(rendered, "\n")