ReactJS Does Not Play Well With WordPress HighlightJS

The nested HTML tags break HighlightJS

 


    printBodyText() {
        if (!this.props.bodyText) {
            return;
        }

        var content = [];

        if(Array.isArray(this.props.bodyText)) {
            var numParagraphs = this.props.bodyText.length;
            for (var index = 0; index < this.props.bodyText.length; ++index) {
                var paragraphString =

                content.push(

{this.props.bodyText[index]}

); } } else { content.push(

{this.props.bodyText}

); } return content }

Bookmark and Share

Leave a Reply

Your email address will not be published. Required fields are marked *