Fallback to feed item description does not strip HTML, only takes 40 chars even though field allows 255

Created on 7 July 2023, 12 months ago
Updated 15 September 2023, 10 months ago

Problem/Motivation

Noticed, while working on moving Drupal.org twitter embed blocks to Mastodon feed blocks. Mastodon feeds do not have item titles, so the description is taken as a fallback. However the description is not stripped of HTML and only the first 40 chars are taken, which is odd given the title could be much longer.

Steps to reproduce

Proposed resolution

Decode entities and strip description of HTML for the title fallback and truncate at 255 chars similar to how it is done before storage in aggregator_aggregator_process(). Add ellipsis to indicate there was more content. Also use the build in Drupal core features for these instead of custom word boundary matching.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Fixed

Version

7.0 ⚰️

Component

aggregator.module

Created by

πŸ‡­πŸ‡ΊHungary GΓ‘bor Hojtsy Hungary

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024