From cf918aacfd5676a99091c4afdfa04bfa020fd5a3 Mon Sep 17 00:00:00 2001 From: Alexei Date: Wed, 25 Oct 2023 13:59:58 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B1=D0=B8=D1=80=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=BD=D0=B0=D1=87=D0=B0=D0=BB=D1=8C=D0=BD=D0=BE=D0=B9?= =?UTF-8?q?=20=D1=84=D1=80=D0=B0=D0=B7=D1=8B=20=D0=B8=D0=B7=20=D1=80=D0=B8?= =?UTF-8?q?=D0=B0=20=D0=BD=D0=BE=D0=B2=D0=BE=D1=81=D1=82=D0=B5=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- news_parser.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/news_parser.js b/news_parser.js index 19ae73f..49f8fff 100644 --- a/news_parser.js +++ b/news_parser.js @@ -180,8 +180,8 @@ function GrubTextFunc(a_Element) { var content = ''; if (a_Element.innerText) { - content = TrimString(a_Element.textContent); - } + content = TrimString(a_Element.textContent); + } return content; } return GrubTextFunc @@ -227,6 +227,13 @@ else if (location.hostname == 'ria.ru') { let base_element = document.getElementsByClassName('article__header')[0]; var base_element_text = document.getElementsByClassName('article__body')[0]; + var tire = ['–', '—', '‒', '―', '⸺', '⸻']; + var clear_text = []; + for (var i in tire) { + var t = tire[i]; + clear_text.push(t + ' РИА Новости. '); + } + content = MakeContentByNews( base_element, base_element, @@ -235,7 +242,7 @@ 'photoview__open', 'article__block', ElementCheckerRia, - ['– РИА Новости. ', '— РИА Новости. '] + clear_text ); } else if (location.hostname == 'zakonvremeni.ru') {