From 89ca858bb57e411bebd0083e4a76b8f70e6fa9aa Mon Sep 17 00:00:00 2001 From: Pascal Hertleif Date: Sat, 10 Jan 2015 11:55:48 +0100 Subject: [PATCH] Fix `playpen.js` errors on `pre`s without IDs This adds an early return to skip code blocks without IDs. Fixes #20864. --- src/librustdoc/html/static/playpen.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/librustdoc/html/static/playpen.js b/src/librustdoc/html/static/playpen.js index 473a20086edb1..f7d6b872940a4 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 = $('').text('⇱').attr('class', 'test-arrow'); var code = $(id).text();