New Github repo: URLParams

I spent more time than I’d have liked last week fixing an issue related to the intermittently incorrect appending of UTM parameters to URLs. Basically, the code worked fine if the link was “basic”, but if it already had  parameters, a second question mark would get added. Since URLs cannot have two question marks, the link would break.

Adding parameters to links sounds simple, until you “roll your own code” and discover issues like– making sure your parameters are URL encoded, and checking to see if the link already has parameters, etc. I decided to capture these hard-won lessons in a JavaScript class called URLParam, and it’s freely available at GitHub.  (It’s worth mentioning– although ES6 classes enjoy wide support across Chrome, Firefox, Edge, Safari, etc., they are not supported in any version of Internet Explorer.)

I hope you’ll find this useful– both in the sense of finishing a coding task faster, and having fewer issues to resolve after deployment.

Workaround for “Add From Selection” bug in Code Snippets Plugin

I’ve found the “Add From Selection” functionality of the Code Snippets plugin has a tendency to crash Notepad++. It had been reported as an issue but does not appear to have been resolved or assigned yet, unfortunately.

The good news is, there’s a fairly trivial workaround for it in the interim. Instead of using “Add From Selection”, use the Copy command (Ctrl + C on Windows) to copy the selection into the system Clipboard, and then use the “Add From Clipboard” option instead.