Skip to content

fix: add title to singular markdown discovery link - #1177

Merged
dkotter merged 5 commits into
WordPress:developfrom
Pranjal1423:fix/markdown-feeds-discovery-link-title
Oct 14, 2026
Merged

dkotter merged 5 commits into
WordPress:developfrom
Pranjal1423:fix/markdown-feeds-discovery-link-title

Conversation

@Pranjal1423

@Pranjal1423 Pranjal1423 commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

What?

Closes #1176

Adds a title attribute to the singular Markdown <link rel="alternate"> autodiscovery tag in Markdown_Feeds::add_discovery_links().

Why?

HTML autodiscovery standards and WordPress core conventions (such as feed_links_extra()) require alternate format links to provide a descriptive title attribute. The site-wide Markdown feed link already includes a title, but the singular link omitted it, leaving the link anonymous to crawlers and user agents.

How?

Updated Markdown_Feeds::add_discovery_links() to pass esc_attr( sprintf( __( '%s (Markdown)', 'ai' ), wp_strip_all_tags( (string) get_the_title( $post ) ) ) ) into the title attribute of the singular <link> tag. Added an assertion to Markdown_FeedsTest::test_discovery_links_on_singular() to verify the title attribute is present.

Use of AI Tools

AI assistance: Yes
Tool(s): Google Antigravity
Model(s): Gemini
Used for: Identifying the missing attribute, drafting the patch, and adding the integration test assertion; final implementation and tests were verified locally by me.

Testing Instructions

  1. Enable the "Markdown Feeds" experiment in Settings > Experiments.
  2. Open any published post on the frontend (e.g. /hello-world/).
  3. View Page Source and search for rel="alternate".
  4. Verify that the singular Markdown link now contains title="<Post Title> (Markdown)".
  5. Run unit tests: phpunit tests/Integration/Includes/Experiments/Markdown_Feeds/Markdown_FeedsTest.php.

Screenshots or screencast

Before After
<link rel="alternate" type="text/markdown" href="http://example.com/hello-world/?output_format=markdown" /> <link rel="alternate" type="text/markdown" title="Hello world! (Markdown)" href="http://example.com/hello-world/?output_format=markdown" />

Changelog Entry

Fixed - Add missing title attribute to singular alternate Markdown discovery link.

Open WordPress Playground Preview

@Pranjal1423
Pranjal1423 requested a review from a team October 14, 2026 07:29
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: Pranjal1423 <pranjal4804@git.wordpress.org>
Co-authored-by: dkotter <dkotter@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@codecov

codecov Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.19%. Comparing base (4578cd4) to head (127c88c).

Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #1177      +/-   ##
=============================================
+ Coverage      82.17%   82.19%   +0.01%     
  Complexity      3399     3399              
=============================================
  Files            136      136              
  Lines          13187    13198      +11     
=============================================
+ Hits           10837    10848      +11     
  Misses          2350     2350              
Flag Coverage Δ
unit 82.19% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread tests/Integration/Includes/Experiments/Markdown_Feeds/Markdown_FeedsTest.php Outdated
Comment thread tests/Integration/Includes/Experiments/Markdown_Feeds/Markdown_FeedsTest.php Outdated
Comment thread includes/Experiments/Markdown_Feeds/Markdown_Feeds.php Outdated
@Pranjal1423
Pranjal1423 requested a review from dkotter October 14, 2026 14:47
@dkotter dkotter added this to the 1.5.0 milestone Oct 14, 2026
@dkotter
dkotter merged commit 005a3e9 into WordPress:develop Oct 14, 2026
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Markdown Feeds: Missing title attribute in singular alternate auto discovery link tag

2 participants