Fix Helsingin Sanomat (dynamic-json)

This commit is contained in:
magnolia1234 2022-04-02 12:50:44 +02:00
parent 0921b4ff20
commit cb6369f3eb
2 changed files with 2 additions and 1 deletions

View file

@ -10,6 +10,7 @@ Add La Opinion de Zamora
Add RedaktionsNetzwerk Deutschland
Fix Alma Talent sites (js-ads)
Fix Australia News Corp (amp)
Fix Helsingin Sanomat (dynamic-json)
Fix Madsack Mediengruppe
Fix NzHerald

View file

@ -991,7 +991,7 @@ else if (matchDomain('hs.fi')) {
img.setAttribute('style', 'width:468px !important');
elem.appendChild(img);
caption = document.createElement('figcaption');
caption_text = slide.split('text:')[1].split(',"text-style"')[0];
caption_text = slide.includes('text:') ? slide.split('text:')[1].split(',"text-style"')[0] : slide.split('caption:')[1].split('",')[0];
if (caption_text.length)
caption_text = caption_text.slice(1, caption_text.length - 1);
par_html = parser.parseFromString('<div>' + DOMPurify.sanitize(caption_text) + '</div>', 'text/html');