We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Url.Search
Url.Hash
AngleSharp.Css
For more information, see the CONTRIBUTING guide.
CONTRIBUTING
Url.Query
""
It is the same for Url.Hash.
Assigning url.Search to url.Search.
url.Search
var url = new AngleSharp.Dom.Url("http://example.com/foo/bar?baz=1#foo"); url.Search = url.Search; url.Hash = url.Hash;
Expected behavior: [What you expected to happen]
void Print(string? text) { Console.WriteLine(text switch { null => "null", "" => "String.Empty", _ => text, }); } var url = new AngleSharp.Dom.Url("http://example.com/foo/bar?baz=1#foo"); Print(url.ToString()); // http://example.com/foo/bar?baz=1#foo Print(url.Fragment); // foo Print(url.Hash); // #foo Print(url.Query); // baz=1 Print(url.Search); // ?baz=1 Print(url.SearchParams.ToString()); // baz=1 url.Hash = url.Hash; url.Search = url.Search; Print(url.ToString()); // http://example.com/foo/bar?baz=1#foo Print(url.Fragment); // foo Print(url.Hash); // #foo Print(url.Query); // baz=1 Print(url.Search); // ?baz=1 Print(url.SearchParams.ToString()); // baz=1
Actual behavior: [What actually happened]
var url = new AngleSharp.Dom.Url("http://example.com/foo/bar?baz=1#foo"); Print(url.Fragment); // foo Print(url.Hash); // #foo Print(url.ToString()); // http://example.com/foo/bar?baz=1#foo Print(url.Query); // baz=1 Print(url.Search); // ?baz=1 url.Search = url.Search; url.Hash = url.Hash; Print(url.Fragment); // #foo Print(url.Hash); // ##foo Print(url.ToString()); // http://example.com/foo/bar?baz=1#foo Print(url.Query); // ?baz=1 Print(url.Search); // ??baz=1
or
var url = new AngleSharp.Dom.Url("http://example.com/foo/bar?baz=1#foo"); Print(url.ToString()); // http://example.com/foo/bar?baz=1#foo Print(url.Fragment); // foo Print(url.Hash); // #foo Print(url.Query); // baz=1 Print(url.Search); // ?baz=1 Print(url.SearchParams.ToString()); // baz=1 url.Search = url.Search; url.Hash = url.Hash; Print(url.ToString()); // http://example.com/foo/bar?baz=1#foo Print(url.Fragment); // #foo Print(url.Hash); // ##foo Print(url.Query); // %3Fbaz=1 Print(url.Search); // ?%3Fbaz=1 Print(url.SearchParams.ToString()); // %3Fbaz=1
Environment details: [OS, .NET Runtime, ...]
kzrnm@bc2e97e
The commit needs #1016.
The text was updated successfully, but these errors were encountered:
It should definitely be the first behavior; if Hash starts with # it should be Substring(1) and same for Search.
Hash
#
Substring(1)
Search
Sorry, something went wrong.
Merge pull request #1021 from kzrnm/feature/#1019
667ca54
Fix Url.Hash and Url.Search
Successfully merging a pull request may close this issue.
Bug Report
Prerequisites
AngleSharp.Css
for CSS support)For more information, see the
CONTRIBUTING
guide.Description
Url.Query
is null,Url.Search
start with '?', otherwiseUrl.Search
is""
.It is the same for
Url.Hash
.Steps to Reproduce
Assigning
url.Search
tourl.Search
.Expected behavior: [What you expected to happen]
Actual behavior: [What actually happened]
or
Environment details: [OS, .NET Runtime, ...]
Possible Solution
kzrnm@bc2e97e
The commit needs #1016.
The text was updated successfully, but these errors were encountered: