Compare commits

..

2 Commits

3 changed files with 31 additions and 7 deletions

6
searchserver/.gitignore vendored Normal file
View File

@ -0,0 +1,6 @@
# Editor
*.swp
*.swo
meilisearch-linux-amd64
data.ms/

14
searchserver/README.md Normal file
View File

@ -0,0 +1,14 @@
# Qotnews Search Server
Download MeiliSearch with:
```
wget https://github.com/meilisearch/MeiliSearch/releases/download/v0.11.1/meilisearch-linux-amd64
chmod +x meilisearch-linux-amd64
```
Run with:
```
MEILI_NO_ANALYTICS=true ./meilisearch-linux-amd64
```

View File

@ -56,9 +56,9 @@ class Article extends React.Component {
let nodes = null; let nodes = null;
if (story.text) { if (story.text) {
let domparser = new DOMParser(); let div = document.createElement('div');
let doc = domparser.parseFromString(story.text, 'text/html'); div.innerHTML = story.text;
nodes = doc.querySelector('body').children; nodes = div.childNodes;
} }
return ( return (
@ -86,10 +86,14 @@ class Article extends React.Component {
<p dangerouslySetInnerHTML={{ __html: x }} /> <p dangerouslySetInnerHTML={{ __html: x }} />
) )
: :
<> (v.nodeName === '#text' ?
<v.localName dangerouslySetInnerHTML={{ __html: v.innerHTML }} /> <p>{v.data}</p>
{v.localName == 'pre' && <button onClick={() => this.pConvert(k)}>Convert Code to Paragraph</button>} :
</> <>
<v.localName dangerouslySetInnerHTML={v.innerHTML ? { __html: v.innerHTML } : null} />
{v.localName == 'pre' && <button onClick={() => this.pConvert(k)}>Convert Code to Paragraph</button>}
</>
)
)} )}
</div> </div>
: :