Skip to content

Footnotes: Trim footnote anchors from excerpts backport from Gutenberg#4845

Closed
ramonjd wants to merge 2 commits intoWordPress:trunkfrom
ramonjd:add/remove-footnotes-from-excerpt
Closed

Footnotes: Trim footnote anchors from excerpts backport from Gutenberg#4845
ramonjd wants to merge 2 commits intoWordPress:trunkfrom
ramonjd:add/remove-footnotes-from-excerpt

Conversation

@ramonjd
Copy link
Copy Markdown
Member

@ramonjd ramonjd commented Jul 14, 2023

Backports changes from WordPress/gutenberg#52518

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

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


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@ramonjd
Copy link
Copy Markdown
Member Author

ramonjd commented Jul 14, 2023

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., WordPress/gutenberg#52628

Prefer PHP 8's str_contains
@mcsf
Copy link
Copy Markdown
Contributor

mcsf commented Jul 14, 2023

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! :)

Copy link
Copy Markdown
Contributor

@costdev costdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates @ramonjd! LGTM 👍

@tellthemachines
Copy link
Copy Markdown
Contributor

Committed in r56244 / 2beefda.

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

Labels

None yet

Projects

No open projects

Development

Successfully merging this pull request may close these issues.

5 participants