voxpelli / webpage-webmentions

A hosted Disqus-like comment service that enables WebMention receiving on any kind of site
https://webmention.herokuapp.com/
MIT License
74 stars 14 forks source link

`[object Object]` issue for some summaries #173

Open voxpelli opened 2 years ago

voxpelli commented 2 years ago

See: https://webmention.herokuapp.com/api/embed?version=cutting-edge&url=http://www.kevinmarks.com/twittereditsyou.html

For some reason the .summary of one of the comments there is an object rather than a string, making the presentation fail:

{
    "url": "https://www.jvt.me/mf2/2022/04/zgycn/",
    "name": "Bookmarked\nIn Soviet Musk Twitter, Twitter edits you\nPost detailsWith all the fuss about Twitter’s promised edit button, and how they might design it, we’re missing a disturbing development — Twitter is using its embedded javascript to edit other people’s sites.Recommended read:\nTwitter Edits You\nhttp://www.kevinmarks.com/twittereditsyou.htmlWed, 06 Apr 2022 08:04 by  Jamie Tanna\n.\n\n#twitter\n#social-media.",
    "published": 1649228640000,
    "summary": {
        "value": "Bookmarked\nIn Soviet Musk Twitter, Twitter edits you\nPost detailsWith all the fuss about Twitter’s promised edit button, and how they might design it, we’re missing a disturbing development — Twitter is using its embedded javascript to edit other people’s sites.",
        "html": "Bookmarked\n<span class=\"u-bookmark-of h-cite\"><a class=\"u-url\" href=\"http://www.kevinmarks.com/twittereditsyou.html\"><span class=\"p-name\">In Soviet Musk Twitter, Twitter edits you</span></a>\n<details open=\"\"><summary>Post details</summary><blockquote class=\"p-summary\">With all the fuss about Twitter&#x2019;s promised edit button, and how they might design it, we&#x2019;re missing a disturbing development &#x2014; Twitter is using its embedded javascript to edit other people&#x2019;s sites.</blockquote><img class=\"u-featured\" src=\"https://www.jvt.me/mf2/2022/04/zgycn/embed-api-delete.png\" loading=\"lazy\" /></details></span><p></p>"
    },
    "author": {
        "name": "Jamie Tanna",
        "photo": "https://www.jvt.me/img/profile.png",
        "url": "https://www.jvt.me/"
    },
    "targets": ["http://www.kevinmarks.com/twittereditsyou.html"],
    "type": "mention",
    "interactions": [],
    "removedTargets": []
}
kevinmarks commented 2 years ago

He's using e-summary, not p-summary so you get the more complex structure. Also it looks like you're using an older version of the microformats parser that doesn't suppress implied name when there is a summary.

voxpelli commented 2 years ago

He's using e-summary, not p-summary so you get the more complex structure.

Great, thanks 👍 I'll try to fix it soon

Also it looks like you're using an older version of the microformats parser that doesn't suppress implied name when there is a summary.

Yes, I'm tracking swapping out the parser in #154