djsudduth / keep-it-markdown

Convert Google Keep notes dynamically to markdown for Obsidian, Logseq, Joplin and Notion using the unofficial Keep API. Also, import simple markdown notes back into Google Keep.
Apache License 2.0
495 stars 32 forks source link

Markdown formatting issues #23

Closed davenicoll closed 3 years ago

davenicoll commented 3 years ago

In a previous commit, line 254 was commented out -

#note_text = gnote.text #gnote.text.replace('”','"').replace('“','"').replace("‘","'").replace("’","'").replace('•', "-").replace(u"\u2610", '[ ]').replace(u"\u2611", '[x]').replace(u'\xa0', u' ').replace(u'\u2013', '--').replace(u'\u2014', '--').replace(u'\u2026', '...').replace(u'\u00b1', '+/-')

This, among other things, means that lists/checkboxes aren't properly converted to markdown. I had to uncomment this line to format my notes correctly.

Was this commented in error?

djsudduth commented 3 years ago

There was a more generalized and cleaner formatting of note text added in 0.4.0 - checkboxes must have been missed. I will check into it.

davenicoll commented 3 years ago

Thanks @djsudduth ... FYI I only discovered after I posted this, that the markdown for a checkbox should be - [ ] or - [x] rather than just [ ].

Btw - thanks for making KIM - for the first time, I'm able to export my keep notes to something usable. Much appreciated.

djsudduth commented 3 years ago

Glad you like it! I could not reproduce the problem. My keep check boxes and lists convert successfully and render markdown in Obsidian and Typora. Do you have an example of how your note was formatted that you saw this issue?

davenicoll commented 3 years ago

Sure, here's a keep that tripped up.

It has an image.

☑ Complete Europe's longest zip line
☑ Visit 10 new national trusts

I'll do some more testing later today.

davenicoll commented 3 years ago

I don't see anywhere else in the code where text boxes are converted to their markdown equivalent, so I wondered if you had a version locally that you've not pushed? I've submitted a update to my PR which includes a fix for this too.

djsudduth commented 3 years ago

@davenicoll - could you take a look at this? Sorry that I missed your pull request yesterday was the other bug and not this one ( I was in a hurry :) ). I don't use lists much so this is probably why the output is incorrect. You mentioned you had the fix to this issue in the other pull request - just redo another pull with just that fix if you have it. Thanks for your help - and sorry about the confusion!

djsudduth commented 3 years ago

PS @davenicoll - the line that was commented out should be reduced to just checkboxes/list markdown. The original reason it was commented out was due to allowing full Unicode/foreign languages. There may be some other markdown conversions necessary besides checkboxes.

djsudduth commented 3 years ago

@davenicoll - will you be taking a look at this? Or, do you want me to incorporate your other pull requests and manually merge it in?

davenicoll commented 3 years ago

Hey @djsudduth, sure, I'll take a look. I'll check the markdown formatting rules and see if anything else should be in there, before submitting a PR.

djsudduth commented 3 years ago

I did the fix - in testing now

djsudduth commented 3 years ago

released in 0.4.2