about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPascal Hertleif <killercup@gmail.com>2015-01-10 11:55:48 +0100
committerPascal Hertleif <killercup@gmail.com>2015-01-10 11:55:48 +0100
commit89ca858bb57e411bebd0083e4a76b8f70e6fa9aa (patch)
treee6ed8bb93d290603de1810274d67fd777dd14de9
parentd36dc159522ea5e587c5c7f6e4df080f063e9b48 (diff)
downloadrust-89ca858bb57e411bebd0083e4a76b8f70e6fa9aa.tar.gz
rust-89ca858bb57e411bebd0083e4a76b8f70e6fa9aa.zip
Fix `playpen.js` errors on `pre`s without IDs
This adds an early return to skip code blocks without IDs.

Fixes #20864.
-rw-r--r--src/librustdoc/html/static/playpen.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/librustdoc/html/static/playpen.js b/src/librustdoc/html/static/playpen.js
index 473a20086ed..f7d6b872940 100644
--- a/src/librustdoc/html/static/playpen.js
+++ b/src/librustdoc/html/static/playpen.js
@@ -14,6 +14,7 @@
 (function() {
     if (window.playgroundUrl) {
         $('pre.rust').hover(function() {
+            if (!$(this).attr('id')) { return; }
             var id = '#' + $(this).attr('id').replace('rendered', 'raw');
             var a = $('<a>').text('⇱').attr('class', 'test-arrow');
             var code = $(id).text();