|
|
|
@ -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 += '<li>' + GrubTextFuncTemplate()(c) + '</li>'; |
|
|
|
|
} |
|
|
|
|
a_Content = '<ul>' + content + '</ul>'; |
|
|
|
|
} |
|
|
|
|
if (a_Element && CheckRegExp(GetElementClassName, 'PageContentCommonStyling_text.*', a_Element)) { |
|
|
|
|
let content = ''; |
|
|
|
|
let childrens = FindElementsByRegExp(GetNodeName, 'P', a_Element); |
|
|
|
@ -285,6 +276,7 @@
|
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
else if (location.hostname == 'ria.ru') { |
|
|
|
|
// test: https://ria.ru/20231020/ssha-1904210900.html
|
|
|
|
|
const base_element = document.getElementsByClassName('article__header')[0]; |
|
|
|
|
const base_element_text = document.getElementsByClassName('article__body')[0]; |
|
|
|
|
const tire = ['-', '–', '—', '‒', '―', '⸺', '⸻']; |
|
|
|
@ -302,7 +294,7 @@
|
|
|
|
|
'photoview__open', |
|
|
|
|
'article__block', |
|
|
|
|
ElementCheckerRia, |
|
|
|
|
clear_text |
|
|
|
|
['</strong>'] |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
else if (location.hostname == 'rg.ru') { |
|
|
|
|