-
Notifications
You must be signed in to change notification settings - Fork 8
Enable SrcSet support with two different input formats for Image tag helper #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
robearlam
merged 66 commits into
Sitecore:main
from
Krishanthaudayakumara:feat/srcset-support
Nov 21, 2025
Merged
Changes from all commits
Commits
Show all changes
66 commits
Select commit
Hold shift + click to select a range
2a8f19c
Enable SrcSet support with three different input formats and test cas…
Krishanthaudayakumara 2d719cd
Remove unnecessary white spaces remained in changes
Krishanthaudayakumara 0937e2f
Add changes to match with content SDK
Krishanthaudayakumara defd382
Alternative approach for parameter preservation in srcSet functionality
Krishanthaudayakumara 6fc8c4f
Enhanced parameter support - Added legacy width and maxWidth paramet…
Krishanthaudayakumara eaa8bc5
Replace var keywords with explicit type declarations
Krishanthaudayakumara e58c52c
feat: Keep URL parameter preservation for srcset and add comprehensiv…
Krishanthaudayakumara 454e049
Remove unnessasary GetMediaLink method overloading
Krishanthaudayakumara 50c37ba
Updated - Enable SrcSet support with Content SDK approach compatibili…
Krishanthaudayakumara 43a09f8
Add comment explanation of GetMediaLinkForSrcSet preservation and usi…
Krishanthaudayakumara 10c272a
refactor the code to eliminate the unnecessary dictionary copying by …
Krishanthaudayakumara 21d8af3
extract the duplicated URL prefix replacement logic into a separate m…
Krishanthaudayakumara 87fabe5
reorder the methods below the properties in ImageTagHelper.cs - SDK.R…
Krishanthaudayakumara 8b1bff5
updated ParseSrcSet in - ImageTagHelper.cs code to use the [srcSetVal…
Krishanthaudayakumara 3e0cb92
Remove unnessasary comments in ImageTagHelper and refactor ParseSrcSe…
Krishanthaudayakumara 99aa164
Remove unnessasary comments in ImageTagHelper and refactor ParseSrcSe…
Krishanthaudayakumara ac23fcb
Throw exception in invalid JSON passing in ParseJsonSrcSet, updated t…
Krishanthaudayakumara f87a037
Add clarification comment for the use of Dictionary<string, object>[]
Krishanthaudayakumara edd2bfd
optimize this by using LINQ's Where() - in GenerateSrcSetAttribute
Krishanthaudayakumara efe5b45
Remove Unnecessary comment
Krishanthaudayakumara ad66f66
Add readable approach in priority checking in GetWidthDescriptor method
Krishanthaudayakumara 6e62708
Remove unnecessary comment
Krishanthaudayakumara 6ccd0bd
refactor the GetWidthDescriptor method to use a helper method and the…
Krishanthaudayakumara 2d3978f
refactor: improve ImageTagHelper test assertions with precise string …
Krishanthaudayakumara fec9351
remove the intermediate variable and casting in ParseJsonSrcSet
Krishanthaudayakumara 2b3c82d
Remove some unnecessary comments used in ImageTagHelper
Krishanthaudayakumara b0887ee
refactor: rename MergeParameters method parameters for clarity
Krishanthaudayakumara fe0a9fe
refactor: extract duplicate parameter processing logic into reusable …
Krishanthaudayakumara d40864e
refactor: extract URL parameter parsing into separate ParseUrlParams …
Krishanthaudayakumara b3407d6
refactor: add using System.Text.Json to remove fully qualified name -…
Krishanthaudayakumara 1343dc7
refactor: move complete URL parsing logic into ParseUrlParams method
Krishanthaudayakumara 03938a6
refactor: move mergedParams declaration to ParseUrlParams call for cl…
Krishanthaudayakumara 09ad819
Intergration tests for GeneratesProperSrcSetAttribute and SrcSetAttri…
Krishanthaudayakumara f6c22c0
Added FourthImage and enhanced integration tests to assert srcset URL…
Krishanthaudayakumara 041c70e
update the testcase ImgTagHelper_SrcSetAttributeContainsCorrectUrls t…
Krishanthaudayakumara 5c4bed2
Complete check of attribute contents in GenerateProperSrcSetAttribute
Krishanthaudayakumara e535930
Remove ImgTagHelper_SrcSetAttributeContainsCorrectUrlsAndSizes and me…
Krishanthaudayakumara 104dea2
Merge pull request #13 from Krishanthaudayakumara/feat/srcset-support…
Krishanthaudayakumara 7560201
Refactor AddParametersToResult to use RouteValueDictionary for object…
Krishanthaudayakumara c317da6
Updated ParseUrlParams to use QueryHelpers.ParseQuery for extracting …
Krishanthaudayakumara 64bdd84
Refactor GetWidthDescriptor to use TryGetValue instead of ContainsKey…
Krishanthaudayakumara 6161068
Remove JSON string support for SrcSet in ImageTagHelper and update tests
Krishanthaudayakumara 0c22634
Merge pull request #14 from Krishanthaudayakumara/feat/srcset-support…
Krishanthaudayakumara ceef4be
Remove blank line to fix the warning - ComponentWithImage.cs
Krishanthaudayakumara 618f8c8
Refactor GetWidthDescriptor to use HtmlHelper.AnonymousObjectToHtmlAt…
Krishanthaudayakumara 7141336
Refactor: Update ParseUrlParams to use Uri type and leverage Uri prop…
Krishanthaudayakumara 1816434
Refactor: Add using for Microsoft.Extensions.Primitives and use Strin…
Krishanthaudayakumara b15b4c1
Simplify ParseUrlParams to handle relative URIs without exceptions
Krishanthaudayakumara b3e5a58
refactor: ParseUrlParams - improve URI parsing in SitecoreFieldExtens…
Krishanthaudayakumara ab6e358
Improve URI parsing in SitecoreFieldExtensions to handle relative and…
Krishanthaudayakumara 03285bf
Avoid multiple return statements and return null in GetMediaLink
Krishanthaudayakumara d227223
fix IDE0090 violations in the SitecoreFieldExtensions file by replac…
Krishanthaudayakumara d87bdfc
Refactor AddParametersToResult using a switch expression pattern and …
Krishanthaudayakumara 7916141
set blank line after closing brace of following change
Krishanthaudayakumara 47c09bf
remove the redundant else block and consolidate to a single return st…
Krishanthaudayakumara 6b64d7a
uses the range indexer original[queryIndex..] in parseUrlParams
Krishanthaudayakumara 8b709c5
Remove var - use explicit types instead of var in changes
Krishanthaudayakumara c5e6a17
use original[..queryIndex]; in ParseUrlParams
Krishanthaudayakumara e0652bc
Remove unnessasary if branch in GenerateSrcSetAttribute - ImageTagHel…
Krishanthaudayakumara 50f7051
use collection initializer syntax to create the list in GenerateSrcSe…
Krishanthaudayakumara 9abddc0
Refactor SrcSet Implementation changes based on PR review - 2025-08-1…
Krishanthaudayakumara 40e565b
Remove multiple return statements - GetMediaLinkForSrcSet
Krishanthaudayakumara 07f9727
Refactor URL parsing to single-return style
Krishanthaudayakumara be01987
Keep null semantics and the explicit IsNullOrEmpty guard, and use a s…
Krishanthaudayakumara 3184370
Ensure we only drop the path when URI parsing succeedsin GetSitecoreM…
Krishanthaudayakumara 7a55d67
Refactor URL parsing and `GetMediaLinkForSrcSet `to single-return sty…
Krishanthaudayakumara File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.