Been working on some javascript bookmarklet code and found this bug in Safari (I’m using version 2.0 (214)).
In the href value of any anchor tag (link), all backslash characters appearing BEFORE a question mark character get replaced with forwardslash characters
this behavior manifests when: - you drag the link to the bookmark bar to make a bookmarklet - you copy the link to clipboard - you look at the link href in the in status bar
this behavior does not seem to manifest when: - you click on the link
Example: The href of <a href=”http://foo\bar\?baz\quux”>TestLink</a> goes from “foo\bar\?baz\quux” to “foo/bar/?baz\quux” – Try It: TestLink
Why does this suck? If you’re writing some javascript code that you’d like users to use as a bookmarklet, and that javascript code includes some regular expression with some backslash characters in it, your regex will get messed up when the user drags your bookmarklet link to their bookmark bar.