mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-28 08:50:06 +02:00
Resolves #488 -- make https-y things links in the console
This commit is contained in:
parent
85ae115fc2
commit
c801f9ed46
2 changed files with 21 additions and 9 deletions
|
@ -100,6 +100,17 @@ var CommandView = React.createClass({
|
||||||
var paragraphs = this.state.result.split("\n");
|
var paragraphs = this.state.result.split("\n");
|
||||||
var result = [];
|
var result = [];
|
||||||
for (var i = 0; i < paragraphs.length; i++) {
|
for (var i = 0; i < paragraphs.length; i++) {
|
||||||
|
if (paragraphs[i].startsWith('https://')) {
|
||||||
|
result.push(
|
||||||
|
<a
|
||||||
|
href={paragraphs[i]}
|
||||||
|
key={'paragraph_' + i}
|
||||||
|
dangerouslySetInnerHTML={{
|
||||||
|
__html: paragraphs[i]
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
} else {
|
||||||
result.push(
|
result.push(
|
||||||
<p
|
<p
|
||||||
key={'paragraph_' + i}
|
key={'paragraph_' + i}
|
||||||
|
@ -109,6 +120,7 @@ var CommandView = React.createClass({
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<div className={'commandLineResult'}>
|
<div className={'commandLineResult'}>
|
||||||
{result}
|
{result}
|
||||||
|
|
|
@ -228,7 +228,7 @@ var Sandbox = Backbone.View.extend({
|
||||||
var url =
|
var url =
|
||||||
'https://learngitbranching.js.org/?NODEMO&command=importTreeNow%20' + escape(treeJSON);
|
'https://learngitbranching.js.org/?NODEMO&command=importTreeNow%20' + escape(treeJSON);
|
||||||
command.setResult(
|
command.setResult(
|
||||||
intl.todo('Here is a link to the current state of the tree: ') + url
|
intl.todo('Here is a link to the current state of the tree: ') + '\n' + url
|
||||||
);
|
);
|
||||||
command.finishWith(deferred);
|
command.finishWith(deferred);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue