mirror of
https://github.com/aljazceru/opencode.git
synced 2026-01-04 08:24:59 +01:00
fix(tui): issue with rendering markdown tables (#1956)
This commit is contained in:
@@ -86,7 +86,7 @@ func Extension(path string) string {
|
|||||||
func ToMarkdown(content string, width int, backgroundColor compat.AdaptiveColor) string {
|
func ToMarkdown(content string, width int, backgroundColor compat.AdaptiveColor) string {
|
||||||
r := styles.GetMarkdownRenderer(width-6, backgroundColor)
|
r := styles.GetMarkdownRenderer(width-6, backgroundColor)
|
||||||
content = strings.ReplaceAll(content, RootPath+"/", "")
|
content = strings.ReplaceAll(content, RootPath+"/", "")
|
||||||
hyphenRegex := regexp.MustCompile(`-([^ ]|$)`)
|
hyphenRegex := regexp.MustCompile(`-([^ \-|]|$)`)
|
||||||
content = hyphenRegex.ReplaceAllString(content, "\u2011$1")
|
content = hyphenRegex.ReplaceAllString(content, "\u2011$1")
|
||||||
rendered, _ := r.Render(content)
|
rendered, _ := r.Render(content)
|
||||||
lines := strings.Split(rendered, "\n")
|
lines := strings.Split(rendered, "\n")
|
||||||
|
|||||||
Reference in New Issue
Block a user