From 177d975b4d9d20d70521796f1edb76a0ba40b388 Mon Sep 17 00:00:00 2001 From: mace Date: Wed, 10 Jun 2026 19:22:24 +0200 Subject: [PATCH] frontend improvement --- .../composables/__tests__/useFeeds.spec.js | 25 +++++++++++++++++++ vue/src/composables/useFeeds.js | 8 +++--- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/vue/src/composables/__tests__/useFeeds.spec.js b/vue/src/composables/__tests__/useFeeds.spec.js index 99646fa..61fe600 100644 --- a/vue/src/composables/__tests__/useFeeds.spec.js +++ b/vue/src/composables/__tests__/useFeeds.spec.js @@ -141,6 +141,31 @@ describe('useFeeds', () => { expect(feeds.value[0].content).not.toContain(' { + feeds.value = [{ + id: 1, + title: 'Article one', + url: 'https://www.dw.com/en/article-one/a-1', + content: '', + }] + axios.post.mockResolvedValueOnce({ + data: { + content: `
+

+ + Der Gender Pay Gap existiert noch immer +

+

some article text long enough for readability to keep the paragraph as the main content body, padded with extra words to pass the content-length heuristics used by Mozilla Readability when scoring candidate nodes.

+
`, + }, + }) + + await getReadable(feeds.value[0], 0) + + expect(feeds.value[0].content).not.toContain('Eingebetteter Audio-Beitrag') + expect(feeds.value[0].content).not.toContain(' { feeds.value = [{ id: 1, diff --git a/vue/src/composables/useFeeds.js b/vue/src/composables/useFeeds.js index ee621b8..3377da6 100644 --- a/vue/src/composables/useFeeds.js +++ b/vue/src/composables/useFeeds.js @@ -93,11 +93,11 @@ async function getReadable(feed, index) { doc.querySelectorAll('img').forEach(resolveTemplatedImage); doc.querySelectorAll('video, audio').forEach(el => el.remove()); // Some feeds (e.g. Deutsche Welle) leave behind a heading + play-icon SVG - // for an embedded video player whose actual