1
Fork 0

Fix playpen.js errors on pres without IDs

This adds an early return to skip code blocks without IDs.

Fixes #20864.
This commit is contained in:
Pascal Hertleif 2015-01-10 11:55:48 +01:00
parent d36dc15952
commit 89ca858bb5

View file

@ -14,6 +14,7 @@
(function() { (function() {
if (window.playgroundUrl) { if (window.playgroundUrl) {
$('pre.rust').hover(function() { $('pre.rust').hover(function() {
if (!$(this).attr('id')) { return; }
var id = '#' + $(this).attr('id').replace('rendered', 'raw'); var id = '#' + $(this).attr('id').replace('rendered', 'raw');
var a = $('<a>').text('⇱').attr('class', 'test-arrow'); var a = $('<a>').text('⇱').attr('class', 'test-arrow');
var code = $(id).text(); var code = $(id).text();