File tree 4 files changed +17
-2
lines changed
4 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -238,9 +238,19 @@ export default class App extends Component {
238
238
locked = { this . state . locked }
239
239
/>
240
240
} ,
241
+ {
242
+ title : 'Raw HTML output' ,
243
+ link : 'https://github.com/linuswillner/react-console-emulator/blob/master/demo/App.jsx#L244-L249' ,
244
+ component : < Terminal
245
+ style = { globalStyles }
246
+ commands = { commands }
247
+ welcomeMessage = 'This terminal should render raw HTML to stdout. Try running the `html` command to see what happens!'
248
+ dangerMode
249
+ />
250
+ } ,
241
251
{
242
252
title : 'Progress demo' ,
243
- link : 'https://github.com/linuswillner/react-console-emulator/blob/master/demo/App.jsx#L244-L271 ' ,
253
+ link : 'https://github.com/linuswillner/react-console-emulator/blob/master/demo/App.jsx#L254-L281 ' ,
244
254
component : < Terminal
245
255
style = { globalStyles }
246
256
ref = { this . progressTerminal }
Original file line number Diff line number Diff line change @@ -29,6 +29,10 @@ export default {
29
29
setTimeout ( ( ) => resolve ( 'Finished!' ) , 1000 )
30
30
} )
31
31
}
32
+ } ,
33
+ html : {
34
+ description : 'Returns a raw HTML string.' ,
35
+ fn : async ( ) => '<span style="color:#c386ff">Hello</span> <span style="color:#fa8072">World</span>'
32
36
}
33
37
} ,
34
38
casingCommands : {
Original file line number Diff line number Diff line change 16
16
"codecov" : " codecov --disable=gcov" ,
17
17
"test" : " npm run lint && npm run test-coverage && npm run codecov" ,
18
18
"test-local" : " npm run lint && npm run test-coverage" ,
19
+ "test-watch" : " npm run test-local -- -- --watch" ,
19
20
"test-coverage" : " cross-env TEST=true jest --config jest.coverage.js" ,
20
21
"test-nocoverage" : " cross-env TEST=true jest --config jest.default.js" ,
21
22
"prepublishOnly" : " npm run compile"
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ export default class TerminalMessage extends Component {
15
15
message : defaults ( style , sourceStyles )
16
16
}
17
17
18
- return this . props . dangerMode
18
+ return this . props . dangerMode && typeof content === 'string'
19
19
? < div className = { className } style = { styles . message } { ...html ( content ) } />
20
20
: < div className = { className } style = { styles . message } > { content } </ div >
21
21
}
You can’t perform that action at this time.
0 commit comments