PlaidWeb / webmention.js

Client-side library for rendering webmentions from webmention.io
MIT License
112 stars 15 forks source link

Quotes in author name break class #14

Closed nekr0z closed 3 years ago

nekr0z commented 3 years ago

webmention.io gets it right (observe author name):

    {
      "type": "entry",
      "author": {
        "type": "card",
        "name": "Максим \"toby3d\" Лебедев",
        "photo": "https://webmention.io/avatar/toby3d.ru/849c8640ffe5baaa2b4d5a488a88dba78df0fadd4ac3cf1ada3a0ff541b377e7.jpg",
        "url": "https://toby3d.ru/"
      },
      "url": "https://toby3d.ru/likes/1",
      "published": "2020-11-16T03:34:07+05:00",
      "wm-received": "2020-11-15T23:30:37Z",
      "wm-id": 913014,
      "wm-source": "https://toby3d.ru/likes/1",
      "wm-target": "https://evgenykuznetsov.org/posts/2020/like/",
      "summary": {
        "content-type": "text/plain",
        "value": "нравится •••"
      },
      "like-of": "https://evgenykuznetsov.org/posts/2020/like/",
      "wm-property": "like-of",
      "wm-private": false,
      "rels": {
        "canonical": "https://toby3d.ru/likes/1/"
      }
    }

but the resulting HTML is somewhat messed up:

<a class="reaction" rel="nofollow ugc" title="Максим " toby3d"="" Лебедев="" liked"="" href="https://toby3d.ru/likes/1"><img src="https://webmention.io/avatar/toby3d.ru/849c8640ffe5baaa2b4d5a488a88dba78df0fadd4ac3cf1ada3a0ff541b377e7.jpg">❤️</a>

Those quotes escaped (or, rather, got unescaped) here, and the class is broken as the result.

fluffy-critter commented 3 years ago

Ah, oops. That seems like it should be pretty easy to fix at least. :)