-
-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ContentExtractor: Fix encoding in JSON-LD
When page has an article body specified in JSON-LD, the HTML fragment is passed to `DOMDocument::loadHTML`. `DOMDocument` will parse a HTML document as ISO-8859-1, unless the document contains an XML encoding declaration or HTML meta tag setting character set. https://stackoverflow.com/a/39148511/160386 JSON-LD typically does not contain `meta[charset]` tag so we need to add it ourselves. At this point the input should already be in UTF-8, as we convert all inputs to that encoding everywhere except in `Graby::cleanupHtml`. There we will clarify the requirement in doc comment.
- Loading branch information
Showing
4 changed files
with
2,002 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.