thanks for comment!
just did a big re-search, problem solved, see comments inlines:
On 08/29/2012 08:27 PM, Lex Trotman wrote:
On 30 August 2012 08:14, ping <[email protected]> wrote:
this doesn't works:
link:http://www-in.abc.com/~pings/webdata/pings-vedio.flv[video]
~ is illegal character in URLs
per
http://en.wikipedia.org/wiki/Percent-encoding#Types_of_URI_characters
RFC 3986 section 2.2 Reserved Characters (January 2005)
~ seems to be legal. I guess it's asciidoc macro that requires a escape?
that said, if I remove the link: and put the URL directly into my
browser, I don't need escape ~.
this works:
link:http://www-in.abc.com/\~pings/webdata/pings-vedio.flv[video]
a "friendly" browser must accept \ as an escape although it isn't standard
again I think this is the way asciidoc macro escape the ~ (super or sub-
script?)
this doesn't work:
link:http://www-in.abc.com/\~pings/webdata/ping's toi_2_0.flv[video]
space ends a macro, the Asciidoc User Guide 21.1.1 says:
"If the <target> necessitates space characters use %20, for example
large%20image.png."
learned now, thanks.
and looks even for "standard" URL, space is also required to be
converted into percent-encode in practice:
http://en.wikipedia.org/wiki/Percent-encoding#Character_data
even this doesn't work
link:http://www-in.abc.com/\~pings/webdata/ping's%20toi_2_0.flv[video]
pass, might be the ' although it is legal in a URL it often has special meaning
and URL displays as (firefox copy link location):
http://www-in.abc.com/%5C~pings/webdata/ping%E2%80%99s%20toi_2_0.flv
Ask firefox.
I did a re-test, looks both firefox/chrome displays this:
http://www-in.abc.net/~pings/webdata/ping%E2%80%99s%20toi_2_0.flv
so looks for some reason single quote(') got translated into "%E2%80%99
what happens here?
Basic advice for URLs (this is not asciidoc specific) is don't use any
punctuation characters without escaping them to hex. That includes
the ~
that's a good idea to simply the work and avoid the mess.
finally I make it work in both browser this way:
link:http://www-in.juniper.net/~pings/webdata/ping%27s%20toi_2_0.flv[video]
basically I:
1) percent encode both space (%20) and '(%27)
2) don't escape ~
so to give a comparison, here are 2 lines in my asciidoc source code
that both work as expected:
link:http://www-in.abc.net/\~pings/webdata/vim-jtac-work.doc[normal
charactors] +
link:http://www-in.abc.net/~pings/webdata/ping%27s%20toi_2_0.flv[special
chars] +
I'm really confused here , but they work.
Cheers
Lex
--
You received this message because you are subscribed to the Google Groups
"asciidoc" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/asciidoc?hl=en.