safeStyle: injectDefaultDocumentStyle()

in frontend/src/common/components/hocr/hocr-document/hocr-document.component.tsx [130:161]


        safeStyle: injectDefaultDocumentStyle(nextProps.userStyle),
      });
    } 
    
    if (this.props.autoFocusId !== nextProps.autoFocusId) {
      this.autoFocusToNode(nextProps.autoFocusId);
    }
    if (this.props.hightlightPageIndex !== nextProps.hightlightPageIndex) {
      this.hightlightPage(nextProps.hightlightPageIndex);
    }
  }

  public shouldComponentUpdate(nextProps: HocrDocumentProps, nextState: HocrDocumentState) {
    return ( 
      this.props.hocr !== nextProps.hocr ||
      this.props.targetWords !== nextProps.targetWords ||
      this.props.caseSensitiveComparison !== nextProps.caseSensitiveComparison ||
      this.props.userStyle !== nextProps.userStyle ||
      this.props.onWordHover !== nextProps.onWordHover ||
      this.props.onPageHover !== nextProps.onPageHover ||
      this.props.className !== nextProps.className ||
      this.state.docBody !== nextState.docBody ||
      this.state.wordCompare !== nextState.wordCompare
    );
  }

  public render() {
    if (!this.state.docBody || !this.state.docBody.children) return null;
    return (
      <div className={cnc(style.container, this.props.className)}>
        <div className={style.viewport} ref={this.saveViewportRef}>
         { getDocNodeChildrenComponents({