On 08/31/2012 02:51 AM, Lex Trotman wrote:
[...]
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 ~.

So long as your browser and server and network is new enough to meet
that standard then ok.  Older systems could modify certain characters
and ~ was one of them. In RFC3986 such "unsafe" characters they have
been included in reserved, but ~ and a couple of others have not, so I
guess the IETF is saying that there are not enough systems that modify
~ left to be bothered with :)

[...]

again I think this is the way asciidoc macro escape the ~ (super or sub-
script?)


For me asciidoc doesn't do anything to the ~, with or without the \.
You need two on the line to be processed as subscript since quotes
need both an opening and closing character.

[...]
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


I see, you were trying to say that the generated html has %E2%80%99 in
it, I misunderstood what you are saying.

Inline macros get the substitutions that are current from their
context (see User Guide Section 21) so a ' is replaced by the Unicode
U+2019 which is a right quote mark. That is one of the standard
replacements.


@Stuart,

User Guide 21 has an extra "macro" in the relevant line, and
apostrophe isn't listed in the manual replacements, but its in
asciidoc.conf.  Also shouldn't the first entry for that replacement
have a (?<!\\) in it, otherwise it will never get to the second?


[...]
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] +


Have a look at the actual generated html, the href should be exactly
what you input, if not then there is something in asciidoc, if the
html is the same as you input then the fact that \~ and ~ are accepted
as the same thing is a function of your browser and server.

Cheers
Lex


hi Lex:
I think you are right. the generated URL is same as what I input in asciidoc.
thank you VERY MUCH for your time and response!

<li>
<p>
<a href="http://www-in.abc.net/\~pings/webdata/vim-jtac-work.doc";>MSword(not tested,may not work)</a><br />
</p>
</li>
<li>
<p>
<a href="http://www-in.abc.net/~pings/webdata/ping%27s%20toi_2_0.flv";>video</a><br />
</p>
<div class="ulist"><ul>
<li>

--
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.

Reply via email to