@@ -702,13 +702,13 @@ var prettyPrint;
702702 'keywords' : SH_KEYWORDS ,
703703 'hashComments' : true ,
704704 'multiLineStrings' : true
705- } ) , [ 'bsh' , 'csh' , 'sh' ] ) ;
705+ } ) , [ 'bash' , ' bsh', 'csh' , 'sh' ] ) ;
706706 registerLangHandler ( sourceDecorator ( {
707707 'keywords' : PYTHON_KEYWORDS ,
708708 'hashComments' : true ,
709709 'multiLineStrings' : true ,
710710 'tripleQuotedStrings' : true
711- } ) , [ 'cv' , 'py' ] ) ;
711+ } ) , [ 'cv' , 'py' , 'python' ] ) ;
712712 registerLangHandler ( sourceDecorator ( {
713713 'keywords' : PERL_KEYWORDS ,
714714 'hashComments' : true ,
@@ -720,12 +720,12 @@ var prettyPrint;
720720 'hashComments' : true ,
721721 'multiLineStrings' : true ,
722722 'regexLiterals' : true
723- } ) , [ 'rb' ] ) ;
723+ } ) , [ 'rb' , 'ruby' ] ) ;
724724 registerLangHandler ( sourceDecorator ( {
725725 'keywords' : JSCRIPT_KEYWORDS ,
726726 'cStyleComments' : true ,
727727 'regexLiterals' : true
728- } ) , [ 'js' ] ) ;
728+ } ) , [ 'javascript' , ' js'] ) ;
729729 registerLangHandler ( sourceDecorator ( {
730730 'keywords' : COFFEE_KEYWORDS ,
731731 'hashComments' : 3 , // ### style block comments
@@ -770,11 +770,16 @@ var prettyPrint;
770770 * or the 1-indexed number of the first line in sourceCodeHtml.
771771 */
772772 function prettyPrintOne ( sourceCodeHtml , opt_langExtension , opt_numberLines ) {
773- var container = document . createElement ( 'pre ' ) ;
773+ var container = document . createElement ( 'div ' ) ;
774774 // This could cause images to load and onload listeners to fire.
775775 // E.g. <img onerror="alert(1337)" src="nosuchimage.png">.
776776 // We assume that the inner HTML is from a trusted source.
777- container . innerHTML = sourceCodeHtml ;
777+ // The pre-tag is required for IE8 which strips newlines from innerHTML
778+ // when it is injected into a <pre> tag.
779+ // http://stackoverflow.com/questions/451486/pre-tag-loses-line-breaks-when-setting-innerhtml-in-ie
780+ // http://stackoverflow.com/questions/195363/inserting-a-newline-into-a-pre-tag-ie-javascript
781+ container . innerHTML = '<pre>' + sourceCodeHtml + '</pre>' ;
782+ container = container . firstChild ;
778783 if ( opt_numberLines ) {
779784 numberLines ( container , opt_numberLines , true ) ;
780785 }
0 commit comments