Fix for URL Embedding (adding support for # and ~ characters)