mirror of
				https://github.com/Alamantus/Lexiconga.git
				synced 2025-11-04 10:17:01 +01:00 
			
		
		
		
	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.
This commit is contained in:
		
							parent
							
								
									0a9259ec56
								
							
						
					
					
						commit
						0c4824e430
					
				
					 1 changed files with 1 additions and 9 deletions
				
			
		| 
						 | 
				
			
			@ -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)
 | 
			
		||||
              && (
 | 
			
		||||
                <p className='word-details'
 | 
			
		||||
                  dangerouslySetInnerHTML={{__html: this.wordDetailsHTML}} />
 | 
			
		||||
                  dangerouslySetInnerHTML={{__html: marked(word.details)}} />
 | 
			
		||||
              )
 | 
			
		||||
            }
 | 
			
		||||
          </div>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue