Format / escape sequences of block attributes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Format / escape sequences of block attributes

oddhack
If I have markup like

[open,myattrib="This is a string"]

what is the syntax of the attribute contents? Are double quotes the only valid delimiters? And, if I want to embed a double quote in the attribute contents, how should I do that?

Thanks,
Jon
Reply | Threaded
Open this post in threaded view
|

Re: Format / escape sequences of block attributes

mojavelinux
Administrator
You can use either double quotes or single quotes to enclose an attribute. Single quotes has special meaning. It means to eagerly apply normal substitution (special chars, attributes, macros, etc) to the value.

If you want to use a quote character in the value that uses the same character as the enclosure, prefix it with a backslash:

foo="ba\"zaar"

The value will become:

ba"zaar

-Dan

On Thu, Jun 22, 2017 at 2:01 PM, oddhack [via Asciidoctor :: Discussion] <[hidden email]> wrote:
If I have markup like

[open,myattrib="This is a string"]

what is the syntax of the attribute contents? Are double quotes the only valid delimiters? And, if I want to embed a double quote in the attribute contents, how should I do that?

Thanks,
Jon



If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Format-escape-sequences-of-block-attributes-tp5693.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
|

Re: Format / escape sequences of block attributes

oddhack
Thanks! Is this covered in the User Guide? I looked through, I think, every instance of "block attribute" and "option" in the document but didn't find it.
Reply | Threaded
Open this post in threaded view
|

Re: Format / escape sequences of block attributes

mojavelinux
Administrator
Your e-mail made me aware that this information was missing. I just added it.


-Dan

p.s. To be honest, the section on attributes needs to be rewritten, but at least the information is mentioned now.

On Thu, Jun 22, 2017 at 3:27 PM, oddhack [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Thanks! Is this covered in the User Guide? I looked through, I think, every instance of "block attribute" and "option" in the document but didn't find it.


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Format-escape-sequences-of-block-attributes-tp5693p5700.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux