The following should work:

[source,xml]
[subs="specialcharacters,quotes"]
----
<root *fx:id="id"*>
  <child/>
</root>
----

You need to include the specialcharacters sub or else the source won't be
properly escaped for XML.

Keep in mind that there are some caveats to doing this because you can
potentially confuse the syntax highlighting libraries (because you are
adding extra characters to the output). Mileage may vary.

If you are using Asciidoctor, this is going to work a lot better. Plus, you
can use the shorthand syntax for adding an additional sub.

[source,xml]
[subs=+quotes]
----
<root *fx:id="id"*>
  <child/>
</root>
----

Another approach is to disable syntax highlighting for these listings. It
can be confusing anyway to have both syntax highlighting and emphasis (they
conflict visually). For that, simply drop the `[source,xml]` line.

Cheers,

-Dan

On Wed, Oct 15, 2014 at 9:34 AM, Yakov Fain <[email protected]> wrote:

> Hi Dan,
>
> I tried it - no luck.
>
> [source, xml]
> [subs="quotes"]
> ----
>   lots of xml was here
>
>         *fx:id="id"*
> ----
>
> The generated HTML rendered only fx:id="id"
>
> Yakov
>
>
> On Tuesday, October 14, 2014 7:45:53 PM UTC-4, Dan Allen wrote:
>>
>> Yep! You just need to add the quotes substitution to the block and you
>> can use inline formatting.
>>
>> [source,java]
>> [subs="quotes"]
>> ----
>> System.out.println("make *this text* bold");
>> ----
>>
>> You'll have to be careful to escape formatting characters in these
>> listings.
>>
>> -Dan
>>
>>
>> On Tue, Oct 14, 2014 at 4:55 PM, Yakov Fain <[email protected]> wrote:
>>
>>> Hello,
>>>
>>> I'm writing a book using asciidoc and need to be able to make in *bold*
>>> a code fragment that's located inside the [source] block.  For example, I
>>> have a code listing A, then added something (e.g. id="password") and want
>>> to show this addition in bold.
>>>
>>> I wonder if anyone knows how to do it?
>>>
>>> Thanks
>>> Yakov Fain
>>>
>>> --
>>> 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.
>>>
>>
>>
>>
>> --
>> 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/d/optout.
>



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

Reply via email to