55°F

Aaron Parecki

  • Articles
  • Notes
  • Photos

Friday, January 12, 2018

← Older → Newer
  • 8:30pm
    Asleep
    5:10am
    Awake
    8h 40m
    Slept
    21m
    Awake for
    Portland, Oregon, USA
    Fri, Jan 12, 2018 5:10am -08:00
  • David Shanske https://david.shanske.com

    Launching of Weather

    Portland, Oregon • 49°F
    2 mentions
    Thu, Jan 11, 2018 11:04pm -05:00 (liked on Fri, Jan 12, 2018 6:25am -08:00)
  • aaronpk https://github.com/aaronpk   •   Jan 12

    #52 Remove images from posts containing a photo

    Aaron Parecki

    Encountered two blockers working on this:

    1) In a simple example of an img tag inside an e-content tag, the parsers are using the img tag as an implied photo property. This seems wrong to me. Example This means XRay sees a post like this as a photo post, and would remove the img tag from the content, which is definitely not the right thing to do.

    <div class="h-entry"><p class="e-content p-name">Hello World <img src="example.jpg"></p></div>
    
    {
        "type": [
            "h-entry"
        ],
        "properties": {
            "name": [
                "Hello World http://example.com/example.jpg"
            ],
            "content": [
                {
                    "html": "Hello World <img src=\"http://example.com/example.jpg\">",
                    "value": "Hello World http://example.com/example.jpg"
                }
            ],
            "photo": [
                "http://example.com/example.jpg"
            ]
        }
    }
    

    2) At the point that XRay is sanitizing the HTML value, the Microformats parser has already converted the HTML to plaintext.

    For example, XRay sees this object and runs the HTML sanitizer on the HTML value:

    {
        "html": "Hello World <img src=\"http://example.com/example.jpg\">",
        "value": "Hello World http://example.com/example.jpg"
    }
    

    This means I can't remove the img tag from the plaintext value since it's already been parsed. I think my only solution for this is going to be to create my own plaintext value out of the sanitized HTML. Unfortunately, that is not a straightforward process, as demonstrated by this relatively long function that does this in the PHP parser. However that might be the technically better option anyway, since XRay can't be sure exactly what method was used to generate the plaintext value from the original HTML anyway.

    Portland, Oregon, USA • 49°F
    Fri, Jan 12, 2018 7:32am -08:00 #xray
  • Aaron Parecki
    at A-Boy plumbing
    Portland, Oregon • Fri, January 12, 2018 3:04pm
    45.535008 -122.621992
    Looking for stuff to mount shelves
    Portland, Oregon • 52°F
    12 Coins
    Fri, Jan 12, 2018 3:04pm -08:00
← Older → Newer

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