about summary refs log tree commit diff
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2015-03-06 09:05:28 +0530
committerManish Goregaokar <manishsmail@gmail.com>2015-03-06 22:22:35 +0530
commita14d6a90527322d8800a80645b35c893d008dd09 (patch)
tree4a27ab5422c58d462d19c4344664b2083484754c
parentbabd41e5e707667e7fc76f5ec5603b37a69b74a2 (diff)
parent1eb37bf4573e6fc28c6595a60dd3868d6c7daea7 (diff)
downloadrust-a14d6a90527322d8800a80645b35c893d008dd09.tar.gz
rust-a14d6a90527322d8800a80645b35c893d008dd09.zip
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).
-rw-r--r--src/librustdoc/html/static/playpen.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustdoc/html/static/playpen.js b/src/librustdoc/html/static/playpen.js
index 687f764f020..8fb979875cd 100644
--- a/src/librustdoc/html/static/playpen.js
+++ b/src/librustdoc/html/static/playpen.js
@@ -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');