Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Homepage Posts: HTML support stopped working in custom excerpts #888

Closed
tmmbecker opened this issue Oct 5, 2021 · 12 comments · Fixed by #1364
Closed

Homepage Posts: HTML support stopped working in custom excerpts #888

tmmbecker opened this issue Oct 5, 2021 · 12 comments · Fixed by #1364

Comments

@tmmbecker
Copy link

By request from CT News Junkie, it would be helpful to add the link capabilities in excerpts. Could we mimic what's been done for HTML support in Subtitles and add it to the excerpts as well?

@laurelfulford
Copy link
Contributor

@tmmbecker Right now the block uses WordPress's the_excerpt() function to pull the auto-generated excerpts, which strips the HTML automatically. I'm personally leery about changing that exactly, since it'll impact both Newspack sites and WP.com (and then we have to deal with things like avoiding splitting up HTML tags when the excerpt is cropped).

In this case, would it work to add the link to the Custom Excerpt instead? It doesn't get stripped out there (I'm not sure it'll allow all HTML, but it does allow the basics); the downside is it's not a nice WYSIWYG editor, so it's not as nice/easy to use.

Let me know what you think!

@tmmbecker
Copy link
Author

@laurelfulford totally my bad on this one for not specifying that this would be for the Custom Excerpt. So what you propose is actually what I had in mind! I'm so sorry for not being clearer.

@laurelfulford
Copy link
Contributor

Thanks @tmmbecker! I totally confused myself when testing this locally -- the links weren't getting stripped out from custom excerpts in the blocks because my version of code wasn't up to date 🤦‍♀️

I'm betting this stopped working due to a regression introduced in the recent excerpts work (#883, #880, #874). I'm going to switch this to a 'bug' since it used to work like this, and still should. Thanks for flagging this!

@laurelfulford laurelfulford added bug Something isn't working and removed enhancement New feature or request labels Oct 6, 2021
@laurelfulford laurelfulford changed the title Homepage Posts: Add HTML support for excerpts Homepage Posts: HTML support stopped working in custom excerpts Oct 6, 2021
@laurelfulford
Copy link
Contributor

^ Also updated the title to reflect the situation!

@akmyta
Copy link

akmyta commented Oct 6, 2021

Hyperallergic is also reporting that their HTML is no longer working in their custom excerpts
p1633558729205000-slack-archives/

@laurelfulford
Copy link
Contributor

Copying this over from #1346 (thanks @Robertght!)

Describe the bug
Custom HTML items like links will get stripped from manual post excerpts.

To Reproduce
Steps to reproduce the behavior:

  1. Publish a post or two and make sure it has a custom excerpt that contains some Custom HTML(I tested with links)
  2. Create a new page and add the Blog Posts block.
  3. Enable the excerpts and make sure the Custom HTML-related content is visible(adjust the word count)
  4. Publish the page and check the results

Expected behavior
The text gets outputted correctly, but the custom HTML isn't so instead of link we get just "link"

This was reported in 5859415-zen and as a workaround a user can have the posts on the default post archive of that theme use the Query Loop Block.

The user claims this was working fine Saturday, but it changed out of nowhere.

Initially reported in Slack: p1673529481724749-slack-C01C378QWRX

The change that caused this was included in the 1.39.0 block release, and WP.com was just synced from 1.37.1 to 1.60, so it makes sense that this is being reported as a new issue there.

@laurelfulford laurelfulford added [Type] Bug and removed bug Something isn't working labels Jan 12, 2023
@liviopv
Copy link

liviopv commented Jan 16, 2023

Another WordPress.com user report:

  • 5865814-zd-woothemes

@liviopv
Copy link

liviopv commented Jan 16, 2023

The closest workaround to this is using the Query Loop Block with the Post Content Block in it and then using the More Block in each post to tweak how much content is displayed. Not ideal, but it will show formatting for "excerpts" in post lists.

@ericdye
Copy link

ericdye commented Jan 18, 2023

Another WordPress.com user has reported this. In this case, line breaks are being ignored.

  • 5875257-zd-woothemes

@ccwalburn
Copy link

Another report here: 5974180-zen

@matticbot
Copy link
Contributor

🎉 This issue has been resolved in version 1.64.0-alpha.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@matticbot
Copy link
Contributor

🎉 This issue has been resolved in version 1.64.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants