fix(plugins): text content output in searx, stackoverflow

This commit is contained in:
Artemy 2024-05-14 13:05:06 +03:00
parent 9a6819e652
commit dba42c64b4
3 changed files with 3 additions and 11 deletions

View File

@ -41,24 +41,17 @@ async function search(
.textContent || '',
};
return {
html: <ResultItem {...parsed} />,
text: `${parsed.title} (${parsed.url})\n${parsed.content}\n---\n\n`,
};
return <ResultItem {...parsed} />;
});
const content = (
<>
{articles_parsed.map((a) => a.html)}
{articles_parsed}
<PageFooter page={page} previous={previous} next={next} />
</>
);
const textContent = articles_parsed.map((a) => a.text).join('');
return {
content: content,
textContent,
title: `"${(document.getElementById('q') as HTMLInputElement).value}" - Searx - Page ${page}`,
};
}

View File

@ -42,7 +42,6 @@ async function users(
{topPosts}
</>
),
textContent: `${ro.q.id}/${ro.q.slug}\n`, // TODO
title: document.querySelector('title')?.textContent || '',
};
}

View File

@ -10,7 +10,7 @@ export namespace JSX {
export function createElement(
name: any,
props: { [id: string]: any },
...inner: any[]
...inner: (string | string[])[]
) {
const content = inner.flat().join('');