Resolves #488 -- make https-y things links in the console

This commit is contained in:
Peter Cottle 2018-10-19 15:08:14 +09:00
parent 85ae115fc2
commit c801f9ed46
2 changed files with 21 additions and 9 deletions

View file

@ -100,14 +100,26 @@ var CommandView = React.createClass({
var paragraphs = this.state.result.split("\n");
var result = [];
for (var i = 0; i < paragraphs.length; i++) {
result.push(
<p
key={'paragraph_' + i}
dangerouslySetInnerHTML={{
__html: paragraphs[i]
}}
/>
);
if (paragraphs[i].startsWith('https://')) {
result.push(
<a
href={paragraphs[i]}
key={'paragraph_' + i}
dangerouslySetInnerHTML={{
__html: paragraphs[i]
}}
/>
);
} else {
result.push(
<p
key={'paragraph_' + i}
dangerouslySetInnerHTML={{
__html: paragraphs[i]
}}
/>
);
}
}
return (
<div className={'commandLineResult'}>