77°F

Aaron Parecki

  • Articles
  • Notes
  • Photos
  • https://github.com/jasnell/w3c-socialwg-activitystreams/issues
    Aaron Parecki
    The definition of properties such as content allow for HTML markup to be included. However, the spec does not require that the media type be specified. This leads to inconsistent results when the consumer doesn't know what to expect.

    For example, if the "content" property *can* contain HTML, a consumer will be either stripping the HTML, sanitizing it, or displaying it directly. However, if a user enters something like "I had a great time at the View Source conference <o>", (<o> being an ascii representation of the conference logo), the consumer would need to HTML escape that before rendering it otherwise it would disappear from display. However there is no way to know whether the value is meant to be the literal text or interpreted as HTML.

    Additionally, the current spec does not allow for different media types for summary and content, since the mediaType property lives next to those properties. The following example demonstrates the problem:

    ```
    {
    "@context": "http://www.w3.org/ns/activitystreams";,
    "type": "Note",
    "mediaType": "text/html",
    "summary": "Hello <o>!",
    "content": "<b>Hello &lt;o&gt;!</b>"
    }
    ```

    My suggestion is to require that string values can *only* be plaintext, and if you want to have HTML for a value, then you enclose it in an object where you can specify mediaType. This would look something like the following, I'm open to suggestions on names:

    ```
    {
    "@context": "http://www.w3.org/ns/activitystreams";,
    "type": "Note",
    "summary": "Plaintext summary, always HTML escaped <o> before displaying",
    "content": {
    "type": "Object",
    "mediaType": "text/html",
    "value": "<p>HTML content goes <b>here</b></p>"
    }
    }
    ```
    Portland, Oregon, USA
    Wed, Nov 4, 2015 11:43am -08:00
Posted in /replies

Hi, I'm Aaron Parecki, Director of Identity Standards at Okta, and co-founder of IndieWebCamp. I maintain oauth.net, write and consult about OAuth, and participate in the OAuth Working Group at the IETF. I also help people learn about video production and livestreaming. (detailed bio)

I've been tracking my location since 2008 and I wrote 100 songs in 100 days. I've spoken at conferences around the world about owning your data, OAuth, quantified self, and explained why R is a vowel. Read more.

  • Director of Identity Standards at Okta
  • IndieWebCamp Founder
  • OAuth WG Editor
  • OpenID Board Member

  • 🎥 YouTube Tutorials and Reviews
  • 🏠 We're building a triplex!
  • ⭐️ Life Stack
  • ⚙️ Home Automation
  • All
  • Articles
  • Bookmarks
  • Notes
  • Photos
  • Replies
  • Reviews
  • Trips
  • Videos
  • Contact
© 1999-2025 by Aaron Parecki. Powered by p3k. This site supports Webmention.
Except where otherwise noted, text content on this site is licensed under a Creative Commons Attribution 3.0 License.
IndieWebCamp Microformats Webmention W3C HTML5 Creative Commons
WeChat ID
aaronpk_tv