File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ $(function() {
3131 return workflowPath . replace ( / \. [ ^ . ] + $ / , ".svg" ) ;
3232 } ) ;
3333 var $codeHeader = createCodeHeader ( "Workflow" ) ;
34- $ ( this ) . first ( ) . before ( $codeHeader ) ;
34+ $ ( this ) . first ( ) . before ( $codeHeader ) . wrap ( "<p></p>" ) ;
3535 $codeHeader . find ( "button" ) . click ( function ( ) {
3636 var $button = $ ( this ) ;
3737 fetch ( workflowPath ) . then ( req => req . text ( ) ) . then ( contents => {
@@ -43,7 +43,10 @@ $(function() {
4343
4444 $ ( "code.hljs" ) . each ( function ( ) {
4545 var $this = $ ( this ) ;
46- var language = / l a n g - ( .+ ?) ( \s | $ ) / . exec ( $this . attr ( "class" ) ) [ 1 ] . toUpperCase ( ) ;
46+ var languageClass = / l a n g - ( .+ ?) ( \s | $ ) / . exec ( $this . attr ( "class" ) )
47+ if ( ! languageClass ) return true ;
48+
49+ var language = languageClass [ 1 ] . toUpperCase ( ) ;
4750 if ( language === 'CS' || language === 'CSHARP' ) {
4851 language = "C#" ;
4952 }
@@ -52,7 +55,7 @@ $(function() {
5255 }
5356 var $codeHeader = createCodeHeader ( language ) ;
5457 var $codeElement = $this . closest ( "pre" ) ;
55- $codeElement . before ( $codeHeader ) ;
58+ $codeElement . before ( $codeHeader ) . wrap ( "<p></p>" ) ;
5659 $codeHeader . find ( "button" ) . click ( function ( ) {
5760 navigator . clipboard . writeText ( $codeElement . text ( ) ) ;
5861 setCopyAlert ( $ ( this ) ) ;
You can’t perform that action at this time.
0 commit comments