Revert "fix: prevent sparse spacing in hyphenated words (#1102)"
publish / publish (push) Has been cancelled

This reverts commit d01fd0a344.
This commit is contained in:
Dax Raad
2025-07-19 19:25:15 -04:00
parent 9f7246e08b
commit 3f0f80297f
3 changed files with 7 additions and 23 deletions
+3 -9
View File
@@ -83,17 +83,11 @@ func Extension(path string) string {
}
func ToMarkdown(content string, width int, backgroundColor compat.AdaptiveColor) string {
renderWidth := width - GetMarkdownContainerFrame()
r := styles.GetMarkdownRenderer(renderWidth, backgroundColor)
r := styles.GetMarkdownRenderer(width-6, backgroundColor)
content = strings.ReplaceAll(content, RootPath+"/", "")
// Apply hyphen preservation during markdown rendering
rendered := ProcessTextWithHyphens(content, func(t string) string {
result, _ := r.Render(t)
return result
})
rendered, _ := r.Render(content)
lines := strings.Split(rendered, "\n")
// Clean up empty lines at start/end
if len(lines) > 0 {
firstLine := lines[0]
cleaned := ansi.Strip(firstLine)