On 27 July 2015 at 21:48, Ken McGlothlen <[email protected]> wrote:
> I'd like to (for example) create a replacement "macro" that will take a
> numeric argument, convert it to hex, and zero-pad it to four characters.
> This doesn't work, of course:
>
> [replacements]
> …
>
> # \hex[255] should output 00FF
>
> \\hex\[(\d+)\]={eval:"%04X" % \1}
>
>
> but that's the idea. Is something like that possible?

I can make the above work by enforcing
[subs="replacements,attributes"] on the paragraph.

But it should work without that, the manual says replacement is done
before the attribute evaluation, so it should be ok.  Not sure why it
doesn't work.

Cheers
Lex

>
> --
> 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/d/optout.

-- 
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/d/optout.

Reply via email to