On 21 February 2014 01:23, Joseph Herlant <[email protected]> wrote:
> Dear all,
>
> Seems that when we include an email in a url in an asciidoc document, the
> html rendering do not recognize the url, but only the the email address is
> clickable (in a weird way).
>
> Reference: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=703575
> Quoting this bug:
>
> ----------------------------------------------
>
> Adding the following URL to an asciidoc file and then rendering it with
> the slidy backend (and possibly other HTML backends, too) results in
> broken HTML code (nested <a href="...">...</a> tags):
>
> example:
> http://example.org/[email protected]
>
> This results in the following broken HTML code:
>
> <a href="http://example.org/?l=<a
> href="mailto:example@example";>example@example</a>.com">http://example.org/?l=<a
> href="mailto:example@example";>example@example</a>.com</a>
>
> Interestingly the top-level-domains ".org" and ".com" are not recognized
> as part of the (falsely identified) e-mail address.
>
> Workaround: Using "%40" instead of "@":
>
> http://qa.debian.org/developer.php?login=pkg-perl-maintainers%40lists.alioth.debian.org
> http://example.org/?l=example%40example.com
>
> Correctly results in:
>
> <a
> href="http://example.org/?l=example%40example.com";>http://example.org/?l=example%40example.com</a>
>
>
> ----------------------------------------------
>
> I tried adding backslash before the "@" which renders the url but do not
> removes the "\".
> I also have the issue with default backend. I don't think it comes from the
> backend.
>
> Before digging in the code, I wonder if all this is an intended behavior?

This is normal macro behaviour.  Macros can nest, so after processing
the http:... macro, the bare email address is recognised and replaced
as well.  Basically allowing bare email addresses to be recognised is
fragile, it might have been better not to recognise them, or to
implement it another way.  But thats hindsight :)

The backslash goes before the whole macro (not something inside it
like the @) to prevent recognition, usually thats the xxx: but for
emails again its dependent on what it recognised.  Again bare emails
are fragile :(

But http://example.org/?l=\[email protected] works ok.

Or your %40 can also be used.

Cheers
Lex

>
> Thanks in advance,
> Joseph
>
> --
> You received this message because you are subscribed to the Google Groups
> "asciidoc" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/asciidoc.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
"asciidoc" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/asciidoc.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to