Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mldoc's astExportMarkdown loses backslash #116

Open
cldwalker opened this issue Jan 19, 2022 · 1 comment
Open

mldoc's astExportMarkdown loses backslash #116

cldwalker opened this issue Jan 19, 2022 · 1 comment

Comments

@cldwalker
Copy link

cldwalker commented Jan 19, 2022

Following up to #112, when I use Mldoc's astExportMarkdown from js (via nbb), I observe that backslashes are removed from the resulting export. Steps to reproduce:

# Build latest mldoc
$ cd /your/local/mldoc
$ make
$ cp _build/default/js/lib.bc.js js/package/index.js

$ git clone https://github.com/cldwalker/nbb-clis && cd nbb-clis
# Install local mldoc until a new one is published
$ cd clis/mldoc
$ npm i /your/local/mldoc/js/package
$ cd -

# Roundtrip example failure
$ echo "- example postgres cmd: \dt" > basic.md
$ logseq-roundtrip basic.md basic2.md
$ diff bas*
1c1
< - example postgres cmd: \dt
---
> - example postgres cmd: dt

You can see that the resulting export removes the backslash. However, it seems backslashes aren't removed if there is whitespace after the backslash.
For example, - alias apm='/Applications/Atom\ Beta.app/Contents/Resources/app/apm/bin/apm' exports the same

@tiensonqin
Copy link
Collaborator

I suspect it's because \d is escaped https://github.com/logseq/mldoc/blob/master/lib/syntax/type_op.ml#L164
@RCmerci shall we add an Inline Escape type so that it can be preserved for later output?

tiensonqin added a commit that referenced this issue Jan 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants