-
Notifications
You must be signed in to change notification settings - Fork 467
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
Rainbow.color can highlight code twice? #93
Comments
@josher19 The code highlighting should not happen more than once if you call https://github.com/ccampbell/rainbow/blob/master/js/rainbow.js#L621-L624 It is possible that there might be some sort of race condition causing both Do you have an example page? I have an api test page here, but I use timeouts that might not be fast enough to reproduce. https://github.com/ccampbell/rainbow/blob/master/tests/api.html If there is no other solution, then your |
@ccampbell Not exactly a minimal example ... I'm working on a documentation module that uses CSS Tooltips to show documented methods and functions. Right now, I'm using your excellent module to render the page, and then adding a Table of Contents and Tooltips dynamically. I want to call two other functions after RainbowCode has finished highlighting the page. // in toc.js:
Rainbow.color(toc); // create table of contents
// in other js file:
Rainbow.color(startDocs); // add tooltips
http://josher19.github.com/minidocs/examples/brocco_ok.html
http://josher19.github.com/minidocs/examples/brocco_broken.html Click: insertHtmlIntoBody on the left.
Once this is working smoothly, I'd be interested in making this a plugin for RainbowCode. |
The tooltips are not working for me on either version. Have you tried using Rainbow.onHighlight(function(block, language) {
$("span.function", block).addClass('tooltip');
}); |
Updated brocco_ok.html and added http://josher19.github.com/minidocs/examples/rainbow.html |
This should be resolved in version 2.0 (#196). Please reopen if it is still an issue |
From @josher19
The text was updated successfully, but these errors were encountered: