-
-
Notifications
You must be signed in to change notification settings - Fork 496
A few nullable changes #527
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,14 +25,22 @@ public bool AutoRelNoFollow | |
| } | ||
| set | ||
| { | ||
| string rel = "nofollow"; | ||
| if (value && !Rel.Contains(rel)) | ||
| const string NoFollow = "nofollow"; | ||
|
|
||
| if (value) | ||
| { | ||
| Rel = string.IsNullOrEmpty(Rel) ? rel : Rel + $" {rel}"; | ||
| if (string.IsNullOrEmpty(Rel)) | ||
| { | ||
| Rel = NoFollow; | ||
| } | ||
| else if (!Rel!.Contains(NoFollow)) | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This logic needs reworked to correctly handle null.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It does handle it via
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indeed. Missed the outer logic changes here. 👍 |
||
| { | ||
| Rel += $" {NoFollow}"; | ||
| } | ||
| } | ||
| else if(!value && Rel.Contains(rel)) | ||
| else | ||
| { | ||
| Rel = Rel.Replace(rel, string.Empty); | ||
| Rel = Rel?.Replace(NoFollow, string.Empty); | ||
| } | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if I'm missing something, but I don't understand this test.
If you don't want the
relbeing output... don't add the extension?