Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the overlapping style issue in render function of field_note #112

Merged
merged 1 commit into from
Jan 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions field_note.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,15 @@ func render(input string) string {
result.WriteString("\033[3m")
italic = true
} else {
result.WriteString("\033[0m")
result.WriteString("\033[23m")
italic = false
}
case '*':
if !bold {
result.WriteString("\033[1m")
bold = true
} else {
result.WriteString("\033[0m")
result.WriteString("\033[22m")
bold = false
}
case '`':
Expand All @@ -222,6 +222,13 @@ func render(input string) string {
result.WriteString(" ")
result.WriteString("\033[0m")
codeblock = false

if bold {
result.WriteString("\033[1m")
}
if italic {
result.WriteString("\033[3m")
}
}
default:
result.WriteRune(char)
Expand Down
Loading