Should substitutions with markup work?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Should substitutions with markup work?

Chuck
I'm trying a fairly simple substitution that doesn't work as I expect it would. I'm wondering if I'm doing something wrong, if it should work at all, or if I've run into a bug.

The code used:
<code>
= {cust_name}  Notes
First Last <flast@example.com>
:showtitle!:
:noheader:
:nofooter:
// Customer Information
:cust_name: Bogus Company
// Repeated information
:text: * *boldedtext*:

{text} first list item
{text} second list item
</code>

What I expect to see is a bulleted list item created with the the text bolded followed by a colon.

What I actually get is the literal text with the asterisks followed by the colon and the test for the list item.

Thanks for any insight to this.
Reply | Threaded
Open this post in threaded view
|

Re: Should substitutions with markup work?

mojavelinux
Administrator
Chuck,

Could you please format the AsciiDoc so that we get a clearer picture of where the endlines are? The best way to do it is to link to a gist.


Cheers,

-Dan

On Thu, Aug 18, 2016 at 3:15 PM, Chuck [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I'm trying a fairly simple substitution that doesn't work as I expect it would. I'm wondering if I'm doing something wrong, if it should work at all, or if I've run into a bug. The code used: = {cust_name} Notes First Last <[hidden email]> :showtitle!: :noheader: :nofooter: // Customer Information :cust_name: Bogus Company // Repeated information :text: * *boldedtext*: {text} first list item {text} second list item What I expect to see is a bulleted list item created with the the text bolded followed by a colon. What I actually get is the literal text with the asterisks followed by the colon and the test for the list item. Thanks for any insight to this.


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Should-substitutions-with-markup-work-tp4891.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: Should substitutions with markup work?

Chuck
Sorry about the previous formatting. It looks good when I see it here.

Here's the gist link to the code.

I've tried it with and without a space after the ":text: * *boldedtext*:" statement.
Ted
Reply | Threaded
Open this post in threaded view
|

Re: Should substitutions with markup work?

Ted
From my experiments it seems that the you cannot substitute text and get the markup to work.

So here's my solution.

= {cust_name}  Notes 
:cust_name: Bogus Company 
:text: boldedtext:


* *{text}* first list item
* *{text}* second list item


I'm sure Dan can explain how it should work.
- Ted @TedAtCIS
Reply | Threaded
Open this post in threaded view
|

Re: Should substitutions with markup work?

mojavelinux
Administrator
Thanks for clarifying, Chuck!

You cannot a whole list item into an attribute. Only the text of an item. The list item markers are only detected in the raw source.

If you want to put markup in attribute text, you must use the inline pass macro to enable substitutions. In other words:

:text: pass:q[*boldedtext*]

* {text}
* {text}

The pass macro is necessary to alter the default substitution order. For details, see http://asciidoctor.org/docs/user-manual/#substitutions-in-an-attribute-entry

Cheers,

-Dan

On Fri, Aug 19, 2016 at 9:44 AM, Ted [via Asciidoctor :: Discussion] <[hidden email]> wrote:
From my experiments it seems that the you cannot substitute text and get the markup to work.

So here's my solution.

= {cust_name}  Notes
:cust_name: Bogus Company
:text: boldedtext:


* *{text}* first list item
* *{text}* second list item

I'm sure Dan can explain how it should work.
- Ted @TedAtCIS



If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Should-substitutions-with-markup-work-tp4891p4895.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: Should substitutions with markup work?

Chuck
@Ted Thanks for confirming what I had found. If Dan hand't upstaged you with the 'pass' option that would have been a good way to go

@Dan Thanks for the clarification and information that the list items can't be passed that way. That gives me a good way of getting it done.