Skip to content

Commit 0164154

Browse files
committed
only try to syntax highlight html
1 parent 9038b98 commit 0164154

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

‎src/skins/vector/views/molecules/MNoticeTile.js‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@ module.exports = React.createClass({
2626
mixins: [MNoticeTileController],
2727

2828
componentDidMount: function() {
29-
HtmlUtils.highlightDom(this.getDOMNode());
29+
if (this.props.mxEvent.getContent().format === "org.matrix.custom.html")
30+
HtmlUtils.highlightDom(this.getDOMNode());
3031
},
3132

3233
componentDidUpdate: function() {
33-
HtmlUtils.highlightDom(this.getDOMNode());
34+
if (this.props.mxEvent.getContent().format === "org.matrix.custom.html")
35+
HtmlUtils.highlightDom(this.getDOMNode());
3436
},
3537

3638
shouldComponentUpdate: function(nextProps) {

‎src/skins/vector/views/molecules/MTextTile.js‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@ module.exports = React.createClass({
2626
mixins: [MTextTileController],
2727

2828
componentDidMount: function() {
29-
HtmlUtils.highlightDom(this.getDOMNode());
29+
if (this.props.mxEvent.getContent().format === "org.matrix.custom.html")
30+
HtmlUtils.highlightDom(this.getDOMNode());
3031
},
3132

3233
componentDidUpdate: function() {
33-
HtmlUtils.highlightDom(this.getDOMNode());
34+
if (this.props.mxEvent.getContent().format === "org.matrix.custom.html")
35+
HtmlUtils.highlightDom(this.getDOMNode());
3436
},
3537

3638
shouldComponentUpdate: function(nextProps) {

0 commit comments

Comments
 (0)