Skip to content

JsonLdParser is trying to parsing invalid data #43

@stargt

Description

@stargt

An URL such as https://www.instagram.com/p/CmHTCMoJSV5/ emits empty string for data because the result of document?.head ?.querySelector("script[type='application/ld+json']") is <html script> at the following method in JsonLdParser.
It produces an exception, FormatException: Unexpected end of input (at character 1)

dynamic _parseToJson(Document? document) {
final data = document?.head
?.querySelector("script[type='application/ld+json']")
?.innerHtml;
if (data == null) {
return null;
}
var d = jsonDecode(data);
return d;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions