File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
src/commons/sideContent/content Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -94,7 +94,6 @@ type SubstVisualizerPropsAST = {
9494} ;
9595
9696const SideContentSubstVisualizer : React . FC < SubstVisualizerPropsAST > = props => {
97- console . log ( props ) ;
9897 const [ stepValue , setStepValue ] = useState ( 1 ) ;
9998 const lastStepValue = props . content . length ;
10099 const hasRunCode = lastStepValue !== 0 ;
@@ -245,10 +244,15 @@ function composeStyleWrapper(
245244 */
246245function renderNode ( currentNode : StepperBaseNode , renderContext : RenderContext ) : React . ReactNode {
247246 const styleWrapper = renderContext . styleWrapper ;
248-
249247 const renderers = {
250248 Literal ( node : StepperLiteral ) {
251- return < span className = "stepper-literal" > { node . raw ? node . raw : node . value } </ span > ;
249+ const stringifyLiteralValue = ( value : any ) =>
250+ typeof value === 'string' ? '"' + value + '"' : value !== null ? value . toString ( ) : 'null' ;
251+ return (
252+ < span className = "stepper-literal" >
253+ { node . raw ? node . raw : stringifyLiteralValue ( node . value ) }
254+ </ span >
255+ ) ;
252256 } ,
253257 Identifier ( node : StepperIdentifier ) {
254258 return < span > { node . name } </ span > ;
You can’t perform that action at this time.
0 commit comments