Skip to content

Support cross-repository redirects and specialized anchor scenarios - #1227

Merged
cotti merged 7 commits into
mainfrom
feature/redirect_extensions
Jun 2, 2025
Merged

cotti merged 7 commits into
mainfrom
feature/redirect_extensions

Conversation

@cotti

@cotti cotti commented May 8, 2025

Copy link
Copy Markdown
Contributor

Closes #670, #847

This MR introduces support for cross-repository redirects, and support for more complex anchor scenarios.

@cotti cotti self-assigned this May 8, 2025
@cotti
cotti requested a review from a team as a code owner May 8, 2025 09:27
@cotti cotti added the feature label May 8, 2025
@reakaleek
reakaleek requested a review from Copilot May 8, 2025 10:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for cross‐repository redirects and enhanced anchor handling in Markdown links.

  • Updated HtmxLinkInlineRenderer to differentiate between cross links and HTTP links.
  • Refactored CrossLinkResolver to improve redirect resolution and error reporting.
  • Enhanced URI validation in DocumentationSet and updated documentation for redirects.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/Elastic.Markdown/Myst/Renderers/HtmxLinkInlineRenderer.cs Introduces new flags (isCrossLink, isHttpLink) and refines hx attribute assignment based on link types.
src/Elastic.Markdown/Links/CrossLinks/CrossLinkResolver.cs Refactors redirect resolution logic with clearer variable naming and improved handling of anchors and lookup paths.
src/Elastic.Markdown/IO/DocumentationSet.cs Adds URI validation for external redirect targets.
docs/contribute/redirects.md Updates documentation with examples on cross-repository redirects and complex anchor scenarios.

'item-a': 'yy'
- to: 'testing/redirects/third-page.md'
anchors:
'item-b':

Copilot AI May 8, 2025

Copy link

Choose a reason for hiding this comment

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

The anchor mapping for 'item-b' is empty, which could be unintentional. Confirm whether this is the desired behavior or if an explicit null/empty value should be specified for clarity.

Suggested change
'item-b':
'item-b': '!'

Copilot uses AI. Check for mistakes.

@Mpdreamz Mpdreamz left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Comment thread docs/contribute/redirects.md Resolved
@reakaleek
reakaleek requested a review from Mpdreamz May 23, 2025 13:02

@Mpdreamz Mpdreamz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A few stylistic nitpicks from me and I think the copilot review has one good suggestion.

Almost LGTM!

@cotti
cotti requested a review from Mpdreamz June 2, 2025 12:41

@Mpdreamz Mpdreamz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@cotti
cotti merged commit 1fa284a into main Jun 2, 2025
@cotti
cotti deleted the feature/redirect_extensions branch June 2, 2025 17:51
@cotti cotti mentioned this pull request Jun 3, 2025
2 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: A way to redirect from one page to another just for specific anchors

3 participants