mozilla / readability

A standalone version of the readability lib
Other
9.03k stars 611 forks source link

The author object in JSON-LD may be an array #617

Closed hiyjeain closed 4 years ago

hiyjeain commented 4 years ago

Summary

The author object in JSON-LD my be an array.

Example

The json-ld data in the 'aclu' test case.

{
    "@context":"http://schema.org",
    "@type":"Article",
    "url":"https://www.aclu.org/blog/privacy-technology/internet-privacy/facebook-tracking-me-even-though-im-not-facebook",
    "inLanguage":"en-US",
    "description":"Facebook collects data about people who have never even opted in. But there are ways these non-users can protect themselves. ",
    "headline":"Facebook Is Tracking Me Even Though I’m Not on Facebook",
    "datePublished":"2018-04-05T06:00",
    "dateModified":"2018-04-11",
    "articleBody":"...",
    "image":{
        "@type":"ImageObject",
        "url":"https://www.aclu.org/sites/default/files/field_image/web18-facebook-1160x768.jpg",
        "width":{
            "@type":"Intangible",
            "name":"1160"
        },
        "height":{
            "@type":"Intangible",
            "name":"768"
        }
    },
    "publisher":{
        "@type":"Organization",
        "name":"American Civil Liberties Union",
        "logo":{
            "@type":"ImageObject",
            "url":"https://www.aclu.org/sites/all/themes/custom/aclu/images/logos/logo-schema-json-ld.png",
            "width":{
                "@type":"Intangible",
                "name":145
            },
            "height":{
                "@type":"Intangible",
                "name":60
            }
        }
    },
    "mainEntityOfPage":{
        "@type":"WebPage",
        "@id":"https://www.aclu.org/blog"
    },
    "keywords":"Internet Privacy, Privacy & Technology, Consumer Privacy",
    "author":[
        {
            "@type":"Person",
            "name":"Daniel Kahn Gillmor"
        }
    ]
}

Expected

Handle this situation. Use the first author as byline or add support for multiple bylines in article structure.

gijsk commented 4 years ago

Hm, wonder why github isn't autoclosing this. Oh well. Thanks very much for the PR!