Hi @paul2009,
Thanks for this awesome solution! Just a note on what others have mentioned re: opening links in new window. I've removed your script from code injection and "open in new window" works as expected, so the issue doesn't seem to be on the Squarespace end. I know you're providing this for free and "as is" (and am very grateful that you do), just wanted to let you know 🙂
Thanks again!