pietroppeter/nimib

Special chars escaped by the markdown renderer

Closed this issue · 2 comments

srozb commented

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"
'''

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 commented

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.