On 10 December 2012 21:21, Alex Efros <[email protected]> wrote:
> Hi!
>
> On Mon, Dec 10, 2012 at 09:07:20PM +1100, Lex Trotman wrote:
>> Please provide an example of the actual source you are using, if you
>> remove parts then you will get incorrect advice and waste both of our time
>
> Ok, no prob, here it is:

Hi Alex,

>
> ---cut---
> _binary-expression:_ ::
>         _monadic-expression_ +
>         _binary-expression binary-operator binary-expression_
>
> _binary-operator:_ one of ::
>         `** * / % + - << >> < > <= >= == != & ^ | :$$$$: && ||`

It does rather make a difference :), just for your future reference
the backquotes are an inline literal, not a monospace quote (thats +
).  The literal just *happens* to be rendered monospace by default.

Where the problem lies is that parsing for document entities like the
:: marking a labelled list item has to happen before macros are
detected within the entity contents.  So the :: is found before the
inline literal macro is detected.  But since the :: splits the input
into the label and the text, neither has the both ends of the inline
literal macro, and so it is not detected and the backquote remains in
the output as you would have noticed.

So as you have done, you have to disrupt the :: so the parser doesn't
see it.  The "official" way to do that is an attribute, which won't be
substituted until after the parser has seen the input.  But that won't
work inside an inline literal.  Your solution works because the $$
macro is detected before the backquote macro so it is substituted with
nothing bringing the :: together again before the backquote makes the
text literal.

If you only wanted monospaced, you could use the ++ quote instead of
backquote, and the the atribute will work.  In that case the attribute
{two-colons} is provided for that purpose, but you might consider that
to be more disruptive than $$$$ although at least its descriptive.
You could define any other attribute name that was more to your liking
:)

As you found using backslash to prevent the parser recognising the ::
works, but then because the content is in an inline literal macro the
\s are retained.

As for the + to cause a line break, no you can't get rid of them
unless you make the whole thing a literal block, which keeps the
layout, but you would have to specify [subs="quotes"] on each block to
get the quotes to work, unless you defined your own new type of block.
 Otherwise the intention of Asciidoc is that line endings are *not*
significant and literals are, well, literal.

Cheers
Lex

>
> _assignment-operator:_ one of ::
>         `= &= |= ^= <<= >>= += -= *= /= %=`
>
> _lvalue-expression:_ ::
>         _identifier_ +
>         +nil+ +
>         _term_ +[+ _expression_ +]+ +
>         _term_ +[+ _expression_ +: ]+ +
>         _term_ +.+ _identifier_ +
>         +(+ _lvalue-expression-list_ +)+ +
>         +*+ _monadic-expression_
> ---cut---
>
> This file was generated by script which convert original .pdf into
> asciidoc. It may seems like markup overkill, but there are good reasons
> why this part of file marked up in this way, other parts of file doesn't
> try to make each word either italic or monospaced. :)
>
> Question is same: how to avoid using $$$$? Another annoying thing is + at EOL.
>
> --
>                         WBR, Alex.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "asciidoc" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/asciidoc?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"asciidoc" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/asciidoc?hl=en.

Reply via email to