Skip to content

The open source coding agent.

TypeScript

fix: markdown lists

adamdotdevinc4ae3e429cd6
diff --git a/packages/tui/internal/util/file.go b/packages/tui/internal/util/file.go
index 943f784fcb0..879e8a6abdf 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")