2

This is more like a doubt. I was trying to add HTML markup text directly into the editor, then It was getting converted to a text with escaped sequences. Could someone please help me if there is any way to keep it as it is.

Example:

Input:

<b>REACT-QUILL</b>

Output:

<b>REACT-QUILL</b>

Required Output:

REACT-QUILL
<ReactQuill
 placeholder="Enter summary"
 value={description.summary}
 onChange={this.onTextEditorChange.bind(this, "description.summary")}
/>

Then in OnChange, I am saving the content.

Then while printing the saved data I am doing this:

    createMarkup() {
        let { html } = this.props;
        return { __html: html };
    }

    render() {
        return (
            <span dangerouslySetInnerHTML={this.createMarkup()}/>
        );
    }

Kindly help me. The when HTML markup is entered, it gets saved escape sequences in props.

algo_user
  • 196
  • 8
  • please provide some code – Jatin Parmar Jan 21 '20 at 07:55
  • https://stackoverflow.com/help/how-to-ask – Bogdan M. Jan 21 '20 at 08:03
  • Did you try using any of the third party packages ? try these 1. [react-html-parser](https://github.com/wrakky/react-html-parser). 2. [htmr](https://github.com/pveyes/htmr) – jarivak Aug 12 '20 at 18:03
  • Yes using a different library could have helped. Actually we were already into using React Quill so had not been able to switch from that. Solved it into custom parsing the output response. Thanks :) – algo_user Aug 19 '20 at 06:41

0 Answers0