Skip to content
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

String match bug cause 'href' can be a list. #2389

Merged
merged 3 commits into from
Feb 19, 2025
Merged

Conversation

@anthonyshull anthonyshull requested a review from a team as a code owner February 19, 2025 16:04
@@ -49,7 +49,7 @@ defmodule Dotcom.ContentRewriters.Links do
href = Map.get(attr_map, "href", "")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like when it's a list it's overwhelmingly a single string in the list. I think we should use this string instead of ignoring it with your change below. Maybe something

href = case Map.get(attr_map, "href") do
  href when is_binary(href) -> href
  [href] -> href
  _ -> ""
end

@thecristen thecristen merged commit 7775495 into main Feb 19, 2025
17 checks passed
@thecristen thecristen deleted the ags/string-match-bug branch February 19, 2025 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants