diff --git a/webclient/src/Article.js b/webclient/src/Article.js index 5a363c8..6b41562 100644 --- a/webclient/src/Article.js +++ b/webclient/src/Article.js @@ -56,9 +56,9 @@ class Article extends React.Component { let nodes = null; if (story.text) { - let domparser = new DOMParser(); - let doc = domparser.parseFromString(story.text, 'text/html'); - nodes = doc.querySelector('body').children; + let div = document.createElement('div'); + div.innerHTML = story.text; + nodes = div.childNodes; } return ( @@ -86,10 +86,14 @@ class Article extends React.Component {

) : - <> - - {v.localName == 'pre' && } - + (v.nodeName === '#text' ? +

{v.data}

+ : + <> + + {v.localName == 'pre' && } + + ) )} :