diff options
Diffstat (limited to 'plugins/jetpack/modules/shortcodes/js/gist.js')
-rw-r--r-- | plugins/jetpack/modules/shortcodes/js/gist.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/plugins/jetpack/modules/shortcodes/js/gist.js b/plugins/jetpack/modules/shortcodes/js/gist.js index a97d7f91..d2d704dc 100644 --- a/plugins/jetpack/modules/shortcodes/js/gist.js +++ b/plugins/jetpack/modules/shortcodes/js/gist.js @@ -2,13 +2,18 @@ var gistStylesheetLoaded = false, gistEmbed = function() { $( '.gist-oembed' ).each( function( i, el ) { - var url = 'https://gist.github.com/' + $( el ).data( 'gist' ); + var url = 'https://gist.github.com/' + $( el ).data( 'gist' ), + ts = Number.parseInt( $( el ).data( 'ts' ), 10 ); $.ajax( { url: url, dataType: 'jsonp', } ).done( function( response ) { - $( el ).replaceWith( response.div ); + if ( ts && 8 !== ts ) { + $( el ).replaceWith( $( response.div ).css( 'tab-size', ts.toString() ) ); + } else { + $( el ).replaceWith( response.div ); + } if ( ! gistStylesheetLoaded ) { var stylesheet = |