Login  Register

Re: Inline roles inside blocks

Posted by msc on Feb 20, 2019; 2:49am
URL: https://discuss.asciidoctor.org/Inline-roles-inside-blocks-tp6758p6761.html


On Feb 20, 2019, at 1:49, mbc [via Asciidoctor :: Discussion] <[hidden email]> wrote:

Hi all!
I need your help!

I need to format a word (color text), but this text exists inside a listing block. For example:

[source]
----
> run mycommand

this is my [red]output
----

What I want to get is the word "output" colored in red.

I don't know how to "escape" the role in this case (included in the listing block).



You need

[source,subs="+quotes,+attributes,+replacements”]
----
this is my [.red]#output#
----

You might not need all the subs. +attributes is the key. I think I have replacements because I am using some &foo; character entities in my listing block. And I might be using the ## construct because I have multiple words. [.red]output might work. I think I have [.red] rather than [red] because I am using a user defined role.

Regards

    -Mark