New: Use Goodreads directly, allow multiple editions of a book (new DB required)

This commit is contained in:
ta264
2020-06-30 21:46:01 +01:00
parent d83d2548e5
commit 45d49117ca
178 changed files with 3332 additions and 1786 deletions

View File

@@ -0,0 +1,13 @@
function stripHtml(html) {
if (!html) {
return html;
}
const fiddled = html.replace(/<br\/>/g, ' ');
const doc = new DOMParser().parseFromString(fiddled, 'text/html');
const text = doc.body.textContent || '';
return text.replace(/([;,.])([^\s.])/g, '$1 $2').replace(/\s{2,}/g, ' ').replace(/s+…/g, '…');
}
export default stripHtml;