Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for a UrlMode parameter to the HtmlLocalLinkParser class, allowing developers to specify how URLs should be rendered (relative, absolute, etc.) when parsing local links. The change is being ported to version 16.
Key changes:
- Added new overload to
EnsureInternalLinksmethod acceptingUrlModeparameter - Updated internal URL generation to respect the specified
UrlMode - Marked the preview-based overload as obsolete
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Umbraco.Core/Templates/HtmlLocalLinkParser.cs | Added new EnsureInternalLinks overload with UrlMode parameter and updated URL generation logic |
| src/Umbraco.Core/PropertyEditors/TextStringValueConverter.cs | Removed preview parameter from EnsureInternalLinks call |
| src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/MarkdownEditorValueConverter.cs | Removed preview parameter from EnsureInternalLinks call |
| src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/RteBlockRenderingValueConverter.cs | Removed preview parameter from EnsureInternalLinks call |
| tests/Umbraco.Tests.UnitTests/Umbraco.Core/Templates/HtmlLocalLinkParserTests.cs | Added comprehensive unit tests for the new UrlMode functionality |
tests/Umbraco.Tests.UnitTests/Umbraco.Core/Templates/HtmlLocalLinkParserTests.cs
Show resolved
Hide resolved
tests/Umbraco.Tests.UnitTests/Umbraco.Core/Templates/HtmlLocalLinkParserTests.cs
Outdated
Show resolved
Hide resolved
tests/Umbraco.Tests.UnitTests/Umbraco.Core/Templates/HtmlLocalLinkParserTests.cs
Outdated
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Forward port of #20200 that required a bit more than just a cherry-pick.
In doing so I noticed we had a method that takes a
previewparameter that was never used, as the method just delegated to the overload without that parameter. So I've obsoleted that and amended each of the callers.Unit tests should verify the changes but a manual test can also be done in a view with e.g:
You should see the URL created with the expected URL mode.