mirror of
https://github.com/rwinkhart/MUTN.git
synced 2026-10-27 13:29:58 -04:00
Support hard line breaks in markdown notes
This commit is contained in:
1 parent
ad7e90c43e
commit
3e37ae8173
2 files changed
+2
-2
No files matched your search
+1
-1
@@ -138,6 +138,6 @@ func editNote(baseNote []string) ([]string, bool) {
|
|||||||
if !reflect.DeepEqual(offline.RemoveTrailingEmptyStrings(note), baseNote) {
|
if !reflect.DeepEqual(offline.RemoveTrailingEmptyStrings(note), baseNote) {
|
||||||
return note, true
|
return note, true
|
||||||
} else {
|
} else {
|
||||||
return note, false
|
return []string{}, false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -46,7 +46,7 @@ func EntryReader(decryptedEntry []string, hidePassword bool, sync bool) {
|
|||||||
for field := 3; field < len(decryptedEntry); field++ {
|
for field := 3; field < len(decryptedEntry); field++ {
|
||||||
markdownNotes = append(markdownNotes, 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"))
|
markdownNotesString, _ := r.Render(strings.Join(markdownNotes, "\n"))
|
||||||
|
|
||||||
// print markdown-rendered notes
|
// print markdown-rendered notes
|
||||||
|
|||||||
Reference in new issue
Block a user