Markdown: implement URI encoding (#60578)
This is a bit of a hack, but short of using URIs.jl (which isn't a
stdlib) or re-implanting a big part of it, it seems like a valid
compromise. More details in a code comment.
Fixes six CommonMark spec tests.