From 01641543da266b8dd5f585eb31f02f0c61b293cb Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sat, 21 Nov 2015 12:33:45 +0000 Subject: [PATCH] only try to syntax highlight html --- src/skins/vector/views/molecules/MNoticeTile.js | 6 ++++-- src/skins/vector/views/molecules/MTextTile.js | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/skins/vector/views/molecules/MNoticeTile.js b/src/skins/vector/views/molecules/MNoticeTile.js index 9883e64b..c905d3be 100644 --- a/src/skins/vector/views/molecules/MNoticeTile.js +++ b/src/skins/vector/views/molecules/MNoticeTile.js @@ -26,11 +26,13 @@ module.exports = React.createClass({ mixins: [MNoticeTileController], componentDidMount: function() { - HtmlUtils.highlightDom(this.getDOMNode()); + if (this.props.mxEvent.getContent().format === "org.matrix.custom.html") + HtmlUtils.highlightDom(this.getDOMNode()); }, componentDidUpdate: function() { - HtmlUtils.highlightDom(this.getDOMNode()); + if (this.props.mxEvent.getContent().format === "org.matrix.custom.html") + HtmlUtils.highlightDom(this.getDOMNode()); }, shouldComponentUpdate: function(nextProps) { diff --git a/src/skins/vector/views/molecules/MTextTile.js b/src/skins/vector/views/molecules/MTextTile.js index 06cc645e..8352ae5c 100644 --- a/src/skins/vector/views/molecules/MTextTile.js +++ b/src/skins/vector/views/molecules/MTextTile.js @@ -26,11 +26,13 @@ module.exports = React.createClass({ mixins: [MTextTileController], componentDidMount: function() { - HtmlUtils.highlightDom(this.getDOMNode()); + if (this.props.mxEvent.getContent().format === "org.matrix.custom.html") + HtmlUtils.highlightDom(this.getDOMNode()); }, componentDidUpdate: function() { - HtmlUtils.highlightDom(this.getDOMNode()); + if (this.props.mxEvent.getContent().format === "org.matrix.custom.html") + HtmlUtils.highlightDom(this.getDOMNode()); }, shouldComponentUpdate: function(nextProps) {