Hootsuite Hootlet causing problems with WordPress code snippets

Last night I reviewed one of my blog posts, and noticed that the source code samples were all scrambled in some places. I eventually figured out that it was the #region and #endregion tags that got messed up. I was surprised that I had not noticed it before, and changed the region tags to comments as a temporary solution.

This morning, on closer inspection, I noticed something suspicious in the scrambled snippets…

The original

Below is an actual code snippet – whether it is scrambled or not will depend on your browser.

public class MyClass
{
	#region Constructor

	public MyClass() { }

	#endregion
}

Here is a screenshot of the code for that snippet:

CropperCapture[4]

The problem

When I view that snippet as a draft post in Google Chrome, I get the following result:

CropperCapture[2]

Those class=”_hootified” statements were what made me suspicious. I had recently installed Hootsuite’s Hootlet browser extension for Google Chrome. I know Chrome uses no extension in incognito mode, so I popped open an incognito window and loaded the exact some page:

CropperCapture[3]

Perfect!

So apparently Hootlet is trying to do something clever with anything marked with a #, probably assuming it’s a Twitter hashtag (like there existed no hashes online pre-Twitter!).

I’m a bit relieved that the error wasn’t in my actual blog source, but I am also concerned that the rendering of those snippets are so unpredictable – how sure can I be that my readers are seeing my code snippets the way I intended?

I’m also not sure who  I should take this up with. Hootsuite? Chrome? WordPress? Rich Hewlett who wrote the WordPress source code plugin for Windows Live Writer? (Thanks Rich, it’s awesome!)

I’ll post an update once I got this figured out!

Update:

I posted about this on the HootSuite forum, and I’m impressed – I got a response in less than 12 hours. They suggest turning off the “Link Twitter status and user profile handles into the HootSuite dashboard” feature by right clicking on the extension icon and selecting Options:

While I appreciate the workaround, I hope they fix this on their end – another reader of my might have the same extension installed and not know about this effect, assuming instead that my code is quite bizarre!

Advertisements
This entry was posted in General Technical and tagged , , , , , , . Bookmark the permalink.

2 Responses to Hootsuite Hootlet causing problems with WordPress code snippets

  1. agwieckowski says:

    Wow. I just ran confusedly afoul of this phenomenon while doing my first tutorial to learn about WordPress code. Thanks for clearing it up!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s