react-html-parser icon indicating copy to clipboard operation
react-html-parser copied to clipboard

Not parsing pre with child node correctly

Open TylerTemp opened this issue 4 years ago • 0 comments

html string:

    <pre>
      <code>
        1
        2
        3
        4
        5
        <span>a</span>
        <span>b</span>
        <span>c</span>
      </code>
    </pre>

outputs:

<pre><code>
        1
        2
        3
        4
        5
        <span>a</span><span>b</span><span>c</span></code></pre>

expected outputs:

<pre><code>
        1
        2
        3
        4
        5
        <span>a</span>
        <span>b</span>
        <span>c</span></code></pre>

the a, b, c in pre in not in one line (as pre will keep the line break), but the parsed result puts them together

react-html-parser version: "2.0.2"

TylerTemp avatar Oct 10 '21 16:10 TylerTemp