cookbook
cookbook copied to clipboard
Can't parse recipe from JSON-LD with "
Description
Due to too eager HtmlEntityDecodeFilter behavior recipes, containing " somewhere cannot be added from URL, because it converts " to " and brokes resulting JSON.
Reproduction Steps to reproduce the behavior:
- Go to main page of cookbook
- Enter https://www.vkusnyblog.ru/recipe/myatnyj-limonad/ into «Download recipe from URL»
- Click on arrow
- See parsing error
Expected behavior Recipe should be added
Actual behavior Instead of recipe error appears
As workaround I propose to add ENT_NOQUOTES flag to HtmlEntityDecodeFilter, like this:
class HtmlEntityDecodeFilter extends AbstractHtmlFilter {
public function apply(string &$html): void {
$html = html_entity_decode($html, ENT_NOQUOTES);
}
}
More correct fix will require some refactoring: IMHO, this filter should be applied only to all text fields in recipe instead of applying to raw data.
Depends on #1110
See #1110