diff --git a/internal/notesnook/model.go b/internal/notesnook/model.go index 7230ba8..9887c38 100644 --- a/internal/notesnook/model.go +++ b/internal/notesnook/model.go @@ -47,27 +47,27 @@ const ( ) type Nook struct { - ID string `json:"id"` - Type Type `json:"type"` - Title string `json:"title,omitempty"` - Pinned bool `json:"pinned,omitempty"` - Topics []Topic `json:"topics,omitempty"` - DateCreated int64 `json:"dateCreated"` - DateModified int64 `json:"dateModified"` - DateEdited int64 `json:"dateEdited,omitempty"` - Synced bool `json:"synced"` - Description string `json:"description,omitempty"` - ContentID string `json:"contentId,omitempty"` - Headline string `json:"headline,omitempty"` - Tags []string `json:"tags,omitempty"` - Locked bool `json:"locked,omitempty"` - Favorite bool `json:"favorite,omitempty"` - LocalOnly bool `json:"localOnly,omitempty"` - Readonly bool `json:"readonly,omitempty"` - NoteID string `json:"noteId,omitempty"` - Data string `json:"data,omitempty"` - NoteIDs []string `json:"noteIds,omitempty"` - From From `json:"from,omitempty"` - To To `json:"to,omitempty"` - Notebooks []Notebook `json:"notebooks,omitempty"` + ID string `json:"id"` + Type Type `json:"type"` + Title string `json:"title,omitempty"` + Pinned bool `json:"pinned,omitempty"` + Topics []Topic `json:"topics,omitempty"` + DateCreated int64 `json:"dateCreated"` + DateModified int64 `json:"dateModified"` + DateEdited int64 `json:"dateEdited,omitempty"` + Synced bool `json:"synced"` + Description string `json:"description,omitempty"` + ContentID string `json:"contentId,omitempty"` + Headline string `json:"headline,omitempty"` + Tags []string `json:"tags,omitempty"` + Locked bool `json:"locked,omitempty"` + Favorite bool `json:"favorite,omitempty"` + LocalOnly bool `json:"localOnly,omitempty"` + Readonly bool `json:"readonly,omitempty"` + NoteID string `json:"noteId,omitempty"` + Data interface{} `json:"data,omitempty"` + NoteIDs []string `json:"noteIds,omitempty"` + From From `json:"from,omitempty"` + To To `json:"to,omitempty"` + Notebooks []Notebook `json:"notebooks,omitempty"` } diff --git a/internal/sn/utils.go b/internal/sn/utils.go index 837cc02..764588c 100644 --- a/internal/sn/utils.go +++ b/internal/sn/utils.go @@ -6,6 +6,7 @@ import ( "strings" md "github.com/JohannesKaufmann/html-to-markdown" + "github.com/JohannesKaufmann/html-to-markdown/plugin" "github.com/PuerkitoBio/goquery" "github.com/google/uuid" @@ -40,7 +41,7 @@ func convertNotesnookToStandardNotes(nooks []notesnook.Nook) StandardNotes { for _, nook := range nooks { switch nook.Type { case notesnook.TypeTipTap: - tipTaps[nook.ID] = nook.Data + tipTaps[nook.ID] = fmt.Sprintf("%s", nook.Data) case notesnook.TypeNotebook: // notebook have topics (I'm treating them as sub notebooks) id := uuid.New() notebooks[nook.ID] = Notebook{ @@ -178,6 +179,7 @@ func ConvertNotebooksToTags() StandardNotes { func convertHTMLToMarkdown(content string) string { converter := md.NewConverter("", true, &md.Options{EscapeMode: "disabled"}) + converter.Use(plugin.GitHubFlavored()) markdown, err := converter.ConvertString(content) if err != nil {