File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -504,6 +504,24 @@ export default class ExecutableFragment extends ExecutableCodeTemplate {
504504
505505 state . exception = null ;
506506 this . update ( state ) ;
507+
508+ if ( targetPlatform === TargetPlatforms . SWIFT_EXPORT ) {
509+ const code = this . nodes [ 0 ]
510+ . querySelector ( SELECTORS . JS_CODE_OUTPUT_EXECUTOR )
511+ . querySelector ( '.result-code' ) ;
512+
513+ if ( code ) {
514+ CodeMirror (
515+ ( elt ) => code . parentNode . replaceChild ( elt , code ) ,
516+ {
517+ mode : 'swift' ,
518+ readOnly : 'nocursorgit st' ,
519+ theme : this . state . theme ,
520+ value : code . innerText ,
521+ } ,
522+ ) ;
523+ }
524+ }
507525 } ) ;
508526 }
509527 } ,
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ export default class JsExecutor {
3838 onError ,
3939 ) {
4040 if ( platform === TargetPlatforms . SWIFT_EXPORT ) {
41- return `<span class="standard-output ${ theme } ">${ jsCode } </span>` ;
41+ return `<span class="standard-output ${ theme } "><div class="result-code"> ${ jsCode } </span>` ;
4242 }
4343 if ( platform === TargetPlatforms . CANVAS ) {
4444 this . iframe . style . display = 'block' ;
You can’t perform that action at this time.
0 commit comments