Wow. A bug in diff-match-patch. Adding a colon to a buffer caused the patch to spit out %3A, which caused a %3A to be inserted.