[wp-trac] [WordPress Trac] #53709: Spaces as <br> in RSS Excerpts
WordPress Trac
noreply at wordpress.org
Sun Jul 25 02:32:39 UTC 2021
#53709: Spaces as <br> in RSS Excerpts
-------------------------------+------------------------------
Reporter: arskrigitsioniets | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Formatting | Version: 5.8
Severity: normal | Resolution:
Keywords: | Focuses:
-------------------------------+------------------------------
Changes (by sabernhardt):
* keywords: reporter-feedback =>
* type: feature request => enhancement
* component: Editor => Formatting
Old description:
> **Problem:** if I use RSS block and want to show text exceprts, all <br>
> elements missing. It loos not very good, like missing spaces after some
> sentences. Look at the image, I higlighted palces where is <br> in
> original RSS feed.
>
> [[Image(https://i.imgur.com/P6MsiL6.jpg)]]
> Feed:
> [https://store.steampowered.com/feeds/news/app/1306770/?cc=RU&l=russian&snr=1_2108_4__2107]
>
> **Suggestion:** RSS block should display all <br> as spaces in excerpts.
New description:
**Problem:** if I use RSS block and want to show text excerpts, all <br>
elements missing. It looks not very good, like missing spaces after some
sentences. Look at the image, I highlighted places where is <br> in
original RSS feed.
[[Image(https://i.imgur.com/P6MsiL6.jpg)]]
Feed:
[https://store.steampowered.com/feeds/news/app/1306770/?cc=RU&l=russian&snr=1_2108_4__2107]
**Suggestion:** RSS block should display all <br> as spaces in excerpts.
--
Comment:
The `wp_trim_words` function in the
[https://github.com/WordPress/gutenberg/blob/7c2fb7cb10421ad9202e2d552dda7abd26e2438b/packages
/block-library/src/rss/index.php#L69 RSS block] and the
[https://core.trac.wordpress.org/browser/trunk/src/wp-
includes/widgets.php?rev=51391#L1579 classic widget] strips all tags
before creating the excerpt.
To replace `br` tags with spaces, would it be good to address that in both
RSS-related files or within the `wp_trim_words` function itself?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/53709#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list