Skip to content

Conversation

flavorjones
Copy link
Contributor

Context

This PR is one in a series that aims to update Mastodon to parse all HTML content as HTML5. See #31812 for a longer explanation.

Changes

Change Nokogiri::HTML to Nokogiri::HTML5.fragment because we're parsing a fragment and not an HTML document. Also change the guard clause to check for children size != 1 because the nodeset may be empty.

because we're parsing a fragment and not an HTML document
@flavorjones flavorjones changed the title use HTML5::DocumentFragment in Account::Field#extract_url_from_html Change Account::Field parsing to use HTML5::DocumentFragment Sep 8, 2024
@flavorjones
Copy link
Contributor Author

The failing test doesn't seem related to this change. Could be a flake?

@Gargron Gargron added this pull request to the merge queue Sep 8, 2024
Merged via the queue into mastodon:main with commit 82161d8 Sep 8, 2024
29 checks passed
@flavorjones flavorjones deleted the flavorjones-account-field-extract-url-is-a-html5-fragment branch September 8, 2024 20:53
justinwritescode pushed a commit to justinwritescode/mastodon that referenced this pull request Sep 15, 2024
nileane pushed a commit to nileane/mastodon that referenced this pull request Sep 17, 2024
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