diff --git a/src/js/app.js b/src/js/app.js index 6bbdee5..e513fde 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -171,47 +171,39 @@ function processParagraphs(pageArr, maxCharsPerPage, content) { function formatText(text) { - /* Useful: https://www.i18nqa.com/debug/utf8-debug.html */ if(!text) { return ""; } else { - //text = text.replace(/

Let's block ads!<\/a><\/strong> \(Why\?\)<\/a><\/p>/g,""); text = text.replace(/
/g, "\n"); + text = text.replace(/.*?<\/caption>/g, ""); text = text.replace(/.*?<\/figcaption>/g, ""); text = text.replace(/.*?<\/small>/g, ""); text = text.replace(/.*?<\/cite>/g, ""); + text = text.replace(/<.*? .*?class=".*?caption.*?".*?>.*?<\/.*?>/g, ""); text = text.replace(/<.*? .*?class=".*?credit.*?".*?>.*?<\/.*?>/g, ""); text = text.replace(/<.*? .*?data-id="injected-recirculation-link".*?>.*?<\/.*?>/g, ""); - // text = text.replace(/<\/{0,1}blockquote.*?>/g, "\""); - text = text.replace(/<[^>]*>/g, ''); + + text = text.replace(/<[^>]*>/g, ''); //Remove html tags. text = text.replace(/[ ]{2,}/g, ' '); //Remove multiple spaces text = text.replace(/ /g, " "); - //text = text.replace(/[“”]/g, '"'); text = text.replace(/"/g, '"'); text = text.replace(/&[lr]dquo;/g, '"'); - //text = text.replace(/̶[0-1];/g, '"'); - - // text = text.replace(/[‘’]/g, "'"); - // text = text.replace(/â€(™|˜)/, "'"); text = text.replace(/&[lr]squo;/g, "'"); - text = text.replace(/̵[6-9];/g, "'"); text = text.replace(/—/g, "—"); - //text = text.replace(/—/g, "—"); text = text.replace(/–/g, "–"); - //text = text.replace(/–/g, "—"); text = text.replace(/…/g, "…"); - //text = text.replace(/…/g, "…"); text = text.replace(/>/g, '>'); text = text.replace(/</g, '<'); text = text.replace(/&/g, "&"); + text = text.replace(/^[<>[\]]*$/g,''); text = text.replace(/^Advertisement$/g,''); text = text.replace(/^Let's block ads! \(Why\?\)$/g,'');