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

Special chars escaped by the markdown renderer #159

Closed
srozb opened this issue Dec 1, 2022 · 2 comments
Closed

Special chars escaped by the markdown renderer #159

srozb opened this issue Dec 1, 2022 · 2 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@srozb
Copy link

srozb commented Dec 1, 2022

Rendering nbCode block to markdown produces invalid code as special characters are being escaped.

Minimal code to reproduce issue:

import nimib

nbInitMd

nbCode:
  let test = "hello world"

nb.filename = "test.md"
nbSave

will produce:

'''nim
let test = "hello world"
'''
@pietroppeter
Copy link
Owner

pietroppeter commented Dec 1, 2022

thanks for reporting this! A bug introduced in 0.3.0 refatoring. Putting here notes for the fix:

  • change this line to {{&code}} (adding &) and same for subsequent {{&output}}
    {{code}}
  • also add & in nbImage partial for caption and url
  • add the snippet above or something more in test (nbSave replaced by something like nb.render)

In case you want to try a PR @srozb, let us know :)

@srozb
Copy link
Author

srozb commented Dec 1, 2022

I've already switched to html backend but appreciate a lot your help on the discord.

I think adding appropriate test case would be helpful to prevent such regression in future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants