On 21 December 2012 04:34, Tom S <[email protected]> wrote: > Hi AsciiDoc Lovers, > > after I've getting familiar with AsciiDoc, I try to define and use my own > macros now. For example, I wanted to mark up keys so I defined a key macro > as follows: > > [macros] > (?su)(?<!\w)[\\]?(?P<name>key):\[(?P<attrlist>.*?)\]= > > For the DocBook backend, I've defined the output definition in the same file > (just for convenience): > > [key-inlinemacro] > # One keycap only. > {2%}<keycap>{1}</keycap> > # Two keycaps: > {2#}{3%}<keycombo> > {2#}{3%} <keycap>{1}</keycap><keycap>{2}</keycap> > {2#}{3%}</keycombo> > # Three keycaps: > {3#}<keycombo> > <keycap>{1}</keycap><keycap>{2}</keycap><keycap>{3}</keycap> > {3#}</keycombo> > > This allows me to use one, two, or three keys and combine them. The > following keys are valid according to the above regex: > > key:[F12] > key:[Strg,Right] > key:[Strg,Shift,Right] > > Well, this works pretty well in "normal" text. However, if I insert such a > key in a footnote, it won't work anymore. For example, if I use the > following text: > > The quick brown fox jumps.{empty}footnote:[This is a footnote with a > key:[Alt,F2] key.]
Hi Tom, needs to be ... key:[Alt,F2\] key.] or the footnote macro ends at the first ] :) The first \ is removed before the contents is scanned for macros. Cheers Lex > > it gives me the following output: > > <simpara>The quick brown fox jumps.<footnote><simpara>This is a footnote > with a <keycombo> > <keycap>Alt</keycap><keycap>F2</simpara></footnote> key.</keycap> > </keycombo></simpara> > > This is wrong. The </keycombo> and the </footnote> end tags are wrongly > placed. > > How comes? Does anybody have an idea what's going wrong here? What did I > wrong? > > Thanks! > > -- > You received this message because you are subscribed to the Google Groups > "asciidoc" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/asciidoc/-/v4vSSL7X7xAJ. > 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. -- 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.
