mirror of
https://github.com/rwinkhart/MUTN.git
synced 2026-08-27 20:36:29 -04:00
Support hard line breaks in markdown notes
This commit is contained in:
+1
-1
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -19,9 +19,6 @@ func DecryptGPG(targetLocation string) []string {
|
||||
os.Exit(1)
|
||||
}
|
||||
outputSlice := strings.Split(string(output), "\n")
|
||||
for i, lineData := range outputSlice {
|
||||
outputSlice[i] = strings.TrimRight(lineData, " \t") // remove trailing whitespace
|
||||
}
|
||||
return outputSlice
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user