This happens because (for some reason) title substitutions are applied in a
different order than normal substitutions:
:title => [:specialcharacters, :quotes, :replacements, :macros,
:attributes, :post_replacements]
Thus, the links have already been processed by the time the macros (which
include links) are discovered.
In theory, one way around this problem is to use an inline pass macro w/ a
custom subs list:
[source,c]
.How to use do-while:
pass:normal[{gitrepo}/blob/master/livro/capitulos/code/cap1/do_while_exemplo.c[code/cap1/do_while_exemplo.c\]]
----
do{
// some code
}while(){
// some code
}
----
However, there seems to be a bug in AsciiDoc that prevents this from
working correct (though it does work in Asciidoctor). The problem is that
the escaped closing square bracket is not processed correctly.
When you are dealing with links, the best solution is to always put them in
an attribute. Here's how that would look:
:src:
{gitrepo}/blob/master/livro/capitulos/code/cap1/do_while_exemplo.c[code/cap1/do_while_exemplo.c]
[source,c]
.How to use do-while: pass:attributes,macros[{src}]
----
do{
// some code
}while(){
// some code
}
----
You can redefined the "src" attribute before each code listing.
Given where that syntax is headed, it might be better to create a custom
inline macro to handle the assembly of the link.
-Dan
On Thu, Sep 12, 2013 at 1:25 PM, Eduardo Santana <[email protected]>wrote:
> Hi,
>
> Here's the problem:
> https://gist.github.com/edusantana/6542122/raw/96bdfa0046b379c26508134b2f8508607657d1ac/title_with_link.asciidoc
>
> If we have an attribute like this:
> :gitrepo: https://github.com/edusantana/linguagem-de-programacao-i-livro
>
> And use it on a title like this:
>
> [source,c]
> .How to use do-while:
> {gitrepo}/blob/master/livro/capitulos/code/cap1/do_while_exemplo.c[code/cap1/do_while_exemplo.c]
> ----
> do{
> // some code
> }while(){
> // some code
> }
> ----
>
> It won't work html/dblatex.
>
> Am I doing some thing wrong?
>
> --
> 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.
>
--
Dan Allen | http://google.com/profiles/dan.j.allen
--
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.