logseq / mldoc

Another Emacs Org-mode and Markdown parser.
GNU Affero General Public License v3.0
233 stars 20 forks source link

mldoc's astExportMarkdown loses property information #112

Closed cldwalker closed 2 years ago

cldwalker commented 2 years ago

Hi @tiensonqin. When I use Mldoc's astExportMarkdown from js (via nbb), I noticed that blocks with only one property do not export their property drawer. Blocks with 2 or more properties export their property drawer fine. I think this is a bug as export should not lose property information. To reproduce, you can use the logseq-roundtrip script which converts markdown file to ast and then exports ast to markdown file. Steps to reproduce

I suspect https://github.com/logseq/mldoc/commit/9aed290e22008adec391528eee64e3305631bb36#r63959759 is the source of the bug but I don't know ocaml

cldwalker commented 2 years ago

@RCmerci Thanks for the fix! Confirmed this works with a local build of master

cldwalker commented 2 years ago

Fyi, I did a roundtrip on 300+ pages and now I only see one minor data loss bug and the rest are just changes in syntax with functionality preserved. Here are the changes in syntax in case it's interesting: