From d5ceed55e4746a3f3d95f50e12b11c36ffa0f91f Mon Sep 17 00:00:00 2001 From: Scott Tolksdorf Date: Thu, 14 Jan 2016 13:35:02 -0500 Subject: [PATCH] Improved the view source to include showing html properly --- client/homebrew/statusbar/statusbar.jsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/client/homebrew/statusbar/statusbar.jsx b/client/homebrew/statusbar/statusbar.jsx index 650b56423..c273d3bf4 100644 --- a/client/homebrew/statusbar/statusbar.jsx +++ b/client/homebrew/statusbar/statusbar.jsx @@ -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('
' + this.props.sourceText + '
'); + + var content = replaceAll(this.props.sourceText, '<', '<'); + content = replaceAll(content, '>', '>'); + + console.log(content); + + sourceWindow.document.write('
' + content + '
'); },