Tag Archives: HTML

Embedding Mastodon posts in WordPress

I’m someone who has made their escape from Twitter, mostly posting to a mix of Mastodon, Threads and Bluesky.

It was really easy to embed a Twitter post in WordPress: just paste the URL into the block editor and it’d do the hard work for you.

That doesn’t work for Mastodon, possibly because it’s so many different domains (servers) that WP can’t figure out when it’s a Mastodon post. Pasting the URL just displays… the URL.

Mastodon does have a function to get the embed code, which you can put into a WP Custom HTML block… but that didn’t work for me either. On my personal blog with its modified Twenty Twenty theme, the Mastodon post appeared hard against the left hand side of the browser window, out of whack with the rest of the post text.

With some experimentation and Googling, I discovered that tweaking the embed code slightly made it better.

Basically in the HTML, edit the blockquote style attribute margin and change it from 0 to auto. That made it appear in line with the rest of the post.

I’d love to show you it here, but it turns out the even older theme we’re using on geekrant.org.right now can’t handle them at all. Attempting to save a post with embedded Mastodon HTML results in a Save error. (And I don’t have time right now to get screen grabs.)

Hmm, might be time for a theme update.

Anyway, hope this helps someone else out there (and remind me of what I need to do next time).

Outlook’s HTML message bloat

I was cleaning up my work mail, which is in Outlook using Exchange. I was staggered to see a relatively short email taking an inordinate amount of space.

Copied the text including headers to a text editor. It was 6300 bytes. But Outlook claimed it was taking 485 Kb — some 76 times the amount of text.

How can this be?

The message was in HTML format. Ah… Microsoft-generated HTML, a receipe for bloat. It seems particularly bad when the message contains a whole email trail.

So, using Outlook’s very handy Edit Message function (I’m surprised it’s not abused more often), I changed it to Plain Text. It’s not as if anything in there relied on the HTML in order to be legible.

Switcheroo, save, presto! 17 Kb. Not 6, but not 485 either. Much better.

Shame there isn’t an option to clean up MS HTML.

Another thing one can do is zip the attachments.

HTML5test.com

Less crazy than the Acid Tests is www.html5test.com

Here’s what I get from a few random browsers I have lying around the place:

Firefox 3.5.9 scores 100 out of 160.

Chrome 4.1 scores 118 out of 160.

IE6? 11 out of 160.

IE8? Surprisingly, only 19 out of 160.

The browser on my Nokia N95 phone doesn’t load the page properly; it just says “Working…” and 0 out of 4 (eg it stalls on the first round of tests).

Interestingly, I also tried IE6 with the Google Chrome Frame in it; it scored 137 out of 160, better than Chrome itself. Weird.

Obviously all the browser authors have a way to go to support this if it’s going to be the bold new standard on the web.

(Found via Andrew)