From 0c4824e430ef1e67e09544f7a924f37b152f965b Mon Sep 17 00:00:00 2001 From: Robbie Antenesse Date: Sun, 10 Dec 2017 14:24:16 -0700 Subject: [PATCH] Don't pre-process markdown in WordDisplay Since we are update words inline, changes in markdown are not shown unless they are re-rendered, which class variables are not. This should hopefully not be too big a processing power hit for large lists, but stress testing should be performed to make sure. --- src/components/display/WordDisplay/index.jsx | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/components/display/WordDisplay/index.jsx b/src/components/display/WordDisplay/index.jsx index 5e9cc36..876a4d3 100644 --- a/src/components/display/WordDisplay/index.jsx +++ b/src/components/display/WordDisplay/index.jsx @@ -24,14 +24,6 @@ export class WordDisplay extends Component { menuIsOpen: false, isEditing: false, } - - this.wordDetailsHTML = marked(props.word.details); - } - - componentWillUpdate (nextProps, nextState) { - if (this.props.word.details !== nextProps.word.details) { - this.wordDetailsHTML = marked(nextProps.word.details); - } } edit () { @@ -158,7 +150,7 @@ export class WordDisplay extends Component { (word.details) && (

+ dangerouslySetInnerHTML={{__html: marked(word.details)}} /> ) }