diff --git a/news_parser.js b/news_parser.js index 2d3bde3..37ddbd8 100644 --- a/news_parser.js +++ b/news_parser.js @@ -137,7 +137,7 @@ } function ElementCheckerRia(a_Element) { - if (a_Element.dataset.type == 'article' || a_Element.dataset.type == 'banner') { + if (a_Element.dataset.type == 'article' || a_Element.dataset.type == 'banner' || a_Element.dataset.type == 'media') { return false; } @@ -193,9 +193,9 @@ }); elements = clear_element.querySelectorAll('a'); - let re = new RegExp("(https?:\/\/.*)"); + //let re = new RegExp("(https?:\/\/.*)"); elements.forEach(function (element) { - if (!re.test(element.pathname)) { + if (element.host == location.hostname) { RemoveCurrentElementSaveChild(element, clear_element); } }); @@ -218,15 +218,6 @@ if (a_ClearTextFunc) { a_Content = a_ClearTextFunc(a_Content); } - if (a_Element && a_Element.dataset && a_Element.dataset.type == 'list') { - let childrens = FindElementsByRegExp(GetElementClassName, 'article__list-item', a_Element); - let content = ''; - for (let i = 0; i < childrens.length; i++) { - let c = childrens[i]; - content += '