0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 22:52:40 +00:00

Improved the view source to include showing html properly

This commit is contained in:
Scott Tolksdorf
2016-01-14 13:35:02 -05:00
parent 4fcc4aa310
commit d5ceed55e4

View File

@@ -5,6 +5,10 @@ var Moment = require('moment');
var Logo = require('naturalCrit/logo/logo.jsx');
var replaceAll = function(str, find, replace) {
return str.replace(new RegExp(find, 'g'), replace);
}
var Statusbar = React.createClass({
getDefaultProps: function() {
@@ -36,7 +40,13 @@ var Statusbar = React.createClass({
openSourceWindow : function(){
var sourceWindow = window.open();
sourceWindow.document.write('<code><pre>' + this.props.sourceText + '</pre></code>');
var content = replaceAll(this.props.sourceText, '<', '&lt;');
content = replaceAll(content, '>', '&gt;');
console.log(content);
sourceWindow.document.write('<code><pre>' + content + '</pre></code>');
},