|
@@ -25,8 +25,6 @@ import (
|
|
|
func toMarkdown(content string, width int, backgroundColor compat.AdaptiveColor) string {
|
|
func toMarkdown(content string, width int, backgroundColor compat.AdaptiveColor) string {
|
|
|
r := styles.GetMarkdownRenderer(width, backgroundColor)
|
|
r := styles.GetMarkdownRenderer(width, backgroundColor)
|
|
|
content = strings.ReplaceAll(content, app.RootPath+"/", "")
|
|
content = strings.ReplaceAll(content, app.RootPath+"/", "")
|
|
|
- content = strings.ReplaceAll(content, "<", "\\<")
|
|
|
|
|
- content = strings.ReplaceAll(content, ">", "\\>")
|
|
|
|
|
rendered, _ := r.Render(content)
|
|
rendered, _ := r.Render(content)
|
|
|
lines := strings.Split(rendered, "\n")
|
|
lines := strings.Split(rendered, "\n")
|
|
|
|
|
|
|
@@ -230,6 +228,10 @@ func renderText(message client.MessageInfo, text string, author string) string {
|
|
|
if message.Role == client.Assistant {
|
|
if message.Role == client.Assistant {
|
|
|
markdownWidth = width - padding - 4 - 2
|
|
markdownWidth = width - padding - 4 - 2
|
|
|
}
|
|
}
|
|
|
|
|
+ if message.Role == client.User {
|
|
|
|
|
+ text = strings.ReplaceAll(text, "<", "\\<")
|
|
|
|
|
+ text = strings.ReplaceAll(text, ">", "\\>")
|
|
|
|
|
+ }
|
|
|
content := toMarkdown(text, markdownWidth, t.BackgroundPanel())
|
|
content := toMarkdown(text, markdownWidth, t.BackgroundPanel())
|
|
|
content = strings.Join([]string{content, info}, "\n")
|
|
content = strings.Join([]string{content, info}, "\n")
|
|
|
|
|
|