refactor(sanitizer): always trim spaces in StripTags#4359
Merged
Conversation
jvoisin
approved these changes
May 24, 2026
Comment on lines
+86
to
+91
| if value = sanitizer.TruncateHTML(value, 100); value == "" { | ||
| continue | ||
| } | ||
|
|
||
| entry.Title = value | ||
| break |
Collaborator
There was a problem hiding this comment.
What's wrong with
Suggested change
| if value = sanitizer.TruncateHTML(value, 100); value == "" { | |
| continue | |
| } | |
| entry.Title = value | |
| break | |
| if value = sanitizer.TruncateHTML(value, 100); value != "" { | |
| entry.Title = value | |
| break | |
| } |
?
Contributor
Author
There was a problem hiding this comment.
Personal preference, really. Makes more sense with #4356.
If you're interested in why the flatter code the better, see uudashr/gocognit with corresponding article and maybe see bkielbasa/cyclop too.
Not dying on that hill though, will make whatever fits here.
Collaborator
There was a problem hiding this comment.
No strong opinion either way, I was just curious
It's never used without being trimmed anyway
12286c4 to
71338e1
Compare
dsh2dsh
added a commit
to dsh2dsh/miniflux
that referenced
this pull request
May 26, 2026
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.
Little follow-up to #4287.
Outputs of
StripTagsandTruncateHTMLnever used without being trimmed.So instead of trimming spaces outside at every call just do it inside.
Have you followed these guidelines?