Make WordPress Core

Opened 11 months ago

Closed 11 months ago

Last modified 11 months ago

#58805 closed defect (bug) (fixed)

Trim footnote anchors from excerpts

Reported by: ramonopoly's profile ramonopoly Owned by: isabel_brison's profile isabel_brison
Milestone: 6.3 Priority: normal
Severity: normal Version:
Component: Editor Keywords: has-patch has-unit-tests gutenberg-merge
Focuses: Cc:

Description

When the post content has one or more footnotes, the excerpt block picks up the link text, the visually hidden star, as part of the content.

See Gutenberg issue for a description of the problem. https://github.com/WordPress/gutenberg/issues/52035

This has been rectified in Gutenberg since: https://github.com/WordPress/gutenberg/pull/52518 and needs to be ported to Core.

Change History (9)

This ticket was mentioned in PR #4845 on WordPress/wordpress-develop by @ramonopoly.


11 months ago
#1

Backports changes from https://github.com/WordPress/gutenberg/pull/52518

Adding a function to wp_trim_excerpt that removes footnotes from content.
Adds tests

Trac ticket: https://core.trac.wordpress.org/ticket/58805

@ramonopoly commented on PR #4845:


11 months ago
#2

cc @mcsf

Not sure if this is what you had in mind. Feel free to trash this one if so 😄

Also not sure if where I've put things is correct, e.g., different file? Different place in the excerpt formatting chain 🤷🏻

I probably need more tests too. Testing this PR surface a couple of bugs, e.g., https://github.com/WordPress/gutenberg/issues/52628

#3 @mukesh27
11 months ago

  • Keywords changes-requested added

Thanks @ramonopoly for ticket and PR. Left some feedback on PR.

#4 @ramonopoly
11 months ago

Thanks @ramonopoly for ticket and PR. Left some feedback on PR.

Thanks! Appreciate it.

#5 @mcsf
11 months ago

@ramonopoly: many thanks for the ticket and patch! It looks good and works well in my testing.
@mukesh27: once you're happy with the changes, feel free to approve this one.

@mcsf commented on PR #4845:


11 months ago
#6

Not sure if this is what you had in mind. Feel free to trash this one if so 😄

I've responded in Trac already, but yeah, this is great! :)

#7 @azaozz
11 months ago

  • Keywords changes-requested removed

The regexp in the PR seems a little bit too specific, but should work. All feedback seems to have been addressed, +1 to commit from me too.

#8 @isabel_brison
11 months ago

  • Owner set to isabel_brison
  • Resolution set to fixed
  • Status changed from new to closed

In 56244:

Editor: trim footnote anchors from post excerpts.

Adds the excerpt_remove_footnotes function to trim footnote anchors from post excerpts.

Props: ramonopoly, costdev, mukesh27, mcsf, azaozz.
Fixes #58805.

@isabel_brison commented on PR #4845:


11 months ago
#9

Committed in r56244 / 2beefda.

Note: See TracTickets for help on using tickets.