From c35e1a03d1eb2db6febadd5205bec0aa785eb02a Mon Sep 17 00:00:00 2001 From: Yihui Khuu Date: Fri, 15 Aug 2025 21:21:08 +1000 Subject: [PATCH] fix(tui): issue with rendering markdown tables (#1956) --- packages/tui/internal/util/file.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/tui/internal/util/file.go b/packages/tui/internal/util/file.go index 879e8a6a..050b9634 100644 --- a/packages/tui/internal/util/file.go +++ b/packages/tui/internal/util/file.go @@ -86,7 +86,7 @@ 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+"/", "") - hyphenRegex := regexp.MustCompile(`-([^ ]|$)`) + hyphenRegex := regexp.MustCompile(`-([^ \-|]|$)`) content = hyphenRegex.ReplaceAllString(content, "\u2011$1") rendered, _ := r.Render(content) lines := strings.Split(rendered, "\n")