Rollup merge of #23082 - killercup:patch-6, r=alexcrichton

This should fix #22615. Previously, the playpen links grabbed the content of all `.rusttest` containers on the same level to build the URL. Now they just select the one before the `pre` they are shown in.

I have only tested this by changing the file in my local build of the docs (not by running rustdoc itself).
This commit is contained in:
Manish Goregaokar 2015-03-06 09:05:28 +05:30
commit a14d6a9052

View File

@ -15,7 +15,7 @@
if (window.playgroundUrl) {
$('pre.rust').hover(function() {
var a = $('<a>').text('⇱').attr('class', 'test-arrow');
var code = $(this).siblings(".rusttest").text();
var code = $(this).prev(".rusttest").text();
a.attr('href', window.playgroundUrl + '?code=' +
encodeURIComponent(code));
a.attr('target', '_blank');