Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#58805 closed defect (bug) (fixed)

Trim footnote anchors from excerpts

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

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.


3 years 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:


3 years 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
3 years ago

  • Keywords changes-requested added

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

#4 @ramonopoly
3 years ago

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

Thanks! Appreciate it.

#5 @mcsf
3 years 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:


3 years 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
3 years 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
3 years ago

  • Owner set to isabel_brison
  • Resolution → fixed
  • Status new → 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:


3 years ago
#9

Committed in r56244 / ​2beefda.

Note: See TracTickets for help on using tickets.