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

array indices parsed as links. #193

Open
bibby opened this issue Feb 15, 2017 · 2 comments
Open

array indices parsed as links. #193

bibby opened this issue Feb 15, 2017 · 2 comments

Comments

@bibby
Copy link

bibby commented Feb 15, 2017

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.

@claudioc
Copy link
Owner

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!

@bibby
Copy link
Author

bibby commented Mar 20, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants