jingo icon indicating copy to clipboard operation
jingo copied to clipboard

array indices parsed as links.

Open bibby opened this issue 8 years ago • 2 comments

We have a fair bit of code examples in our jingo wiki, and we've noticed that condensed code can be rendered as links.

rownames(rtmp) <- rownames(some_list[[1]])

this comes out as

rownames(rtmp) <- rownames(some_list<a class="internal" href="/wiki/1">1</a>)

As a workaround, I've hacked the renderer.js to ignore blocks where the content is numeric or has quotes. A longer term solution might be to ignore links that are in code blocks, but I don't know what would work for everyone.

bibby avatar Feb 15 '17 00:02 bibby

Hi,

yeah, apparently the markdown renderer that Jingo uses has some limitations. In another issue, someone suggested me to change the parser. I will take a look at it and I will see if this also fixes this problem.

Can you please attach here the hack you applied so I can see if I can generalised it?

Thanks for reporting!

claudioc avatar Mar 12 '17 14:03 claudioc

To work around this, I added an ignore pattern to lib/renderer.js . The extractTags function had some avoidance patterns, so I included one that skipped brackets containing a number.

https://gist.github.com/bibby/f7849feea5d1f6439472a3debb8e335c#file-renderer-js-L80-L83

I did not consider making a pull request, because I don't think that this is universally useful; Labeling numeric footnotes, for instance, wouldn't be possible as it is after this change. For our current use-case, though, it's satisfactory.

bibby avatar Mar 20 '17 17:03 bibby