fix(workspace): support multi-line bullets via Shift+Enter and preserve lines on Enter
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 1m0s
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 1m0s
This commit is contained in:
1 parent
b0403e09bc
commit
518a0903dd
2 files changed
+361
-176
No files matched your search
@@ -1178,13 +1178,16 @@ func (s *Store) saveDocumentToDisk(doc *domain.Document) {
|
||||
if b.Checked {
|
||||
chk = "x"
|
||||
}
|
||||
md.WriteString(fmt.Sprintf("%s- [%s] %s\n", indent, chk, b.Content))
|
||||
formatted := strings.ReplaceAll(b.Content, "\n", "\n"+indent+" ")
|
||||
md.WriteString(fmt.Sprintf("%s- [%s] %s\n", indent, chk, formatted))
|
||||
case "bullet", "paragraph":
|
||||
md.WriteString(fmt.Sprintf("%s- %s\n", indent, b.Content))
|
||||
formatted := strings.ReplaceAll(b.Content, "\n", "\n"+indent+" ")
|
||||
md.WriteString(fmt.Sprintf("%s- %s\n", indent, formatted))
|
||||
case "code":
|
||||
md.WriteString(fmt.Sprintf("%s- ```%s\n%s %s\n%s ```\n", indent, b.Lang, indent, b.Content, indent))
|
||||
case "callout":
|
||||
md.WriteString(fmt.Sprintf("%s- > %s\n", indent, b.Content))
|
||||
formatted := strings.ReplaceAll(b.Content, "\n", "\n"+indent+" > ")
|
||||
md.WriteString(fmt.Sprintf("%s- > %s\n", indent, formatted))
|
||||
case "divider":
|
||||
md.WriteString(fmt.Sprintf("%s- ---\n", indent))
|
||||
case "table":
|
||||
@@ -1192,7 +1195,8 @@ func (s *Store) saveDocumentToDisk(doc *domain.Document) {
|
||||
case "progress":
|
||||
md.WriteString(fmt.Sprintf("%s- <!-- progress: %s -->\n", indent, b.Content))
|
||||
default:
|
||||
md.WriteString(fmt.Sprintf("%s- %s\n", indent, b.Content))
|
||||
formatted := strings.ReplaceAll(b.Content, "\n", "\n"+indent+" ")
|
||||
md.WriteString(fmt.Sprintf("%s- %s\n", indent, formatted))
|
||||
}
|
||||
}
|
||||
} else if doc.Content != "" {
|
||||
|
||||
Reference in new issue
Block a user