mirror of
https://github.com/rwinkhart/MUTN.git
synced 2026-09-05 16:47:20 -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) {
|
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
|
||||||
|
|||||||
@@ -19,9 +19,6 @@ func DecryptGPG(targetLocation string) []string {
|
|||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
outputSlice := strings.Split(string(output), "\n")
|
outputSlice := strings.Split(string(output), "\n")
|
||||||
for i, lineData := range outputSlice {
|
|
||||||
outputSlice[i] = strings.TrimRight(lineData, " \t") // remove trailing whitespace
|
|
||||||
}
|
|
||||||
return outputSlice
|
return outputSlice
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user