Support hard line breaks in markdown notes

This commit is contained in:
2024-04-05 14:18:35 -04:00
parent ad7e90c43e
commit 3e37ae8173
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -138,6 +138,6 @@ func editNote(baseNote []string) ([]string, bool) {
if !reflect.DeepEqual(offline.RemoveTrailingEmptyStrings(note), baseNote) {
return note, true
} else {
return note, false
return []string{}, false
}
}
+1 -1
View File
@@ -46,7 +46,7 @@ func EntryReader(decryptedEntry []string, hidePassword bool, sync bool) {
for field := 3; field < len(decryptedEntry); field++ {
markdownNotes = append(markdownNotes, decryptedEntry[field])
}
r, _ := glamour.NewTermRenderer(glamour.WithStylesFromJSONBytes(glamourStyle()))
r, _ := glamour.NewTermRenderer(glamour.WithStylesFromJSONBytes(glamourStyle()), glamour.WithPreservedNewLines())
markdownNotesString, _ := r.Render(strings.Join(markdownNotes, "\n"))
// print markdown-rendered notes