On 03/02/11 09:29, Lex Trotman wrote:
On 2 February 2011 23:43, Michael Wild<[email protected]>  wrote:
On 02/02/2011 12:18 PM, Lex Trotman wrote:
On 2 February 2011 21:36, Michael Wild<[email protected]>  wrote:
Hi all

I just stumbled across this problem (probably because the regex for
`monospaced` quotes is greedy?). I don't think that it can be fixed
though...

---------<8----------
== Quoting Problem

The `single quoted text' is fine.

This `single quoted text', however, is borked by the `monospaced quote`.

This `single quoted text' is fine, because using + instead of ` fixes
the issue: +monospaced quote+.
---------<8----------

Michael


Could you describe the output please, 'borked' is imprecisely defined :-)

Cheers
Lex

Why not just run it through asciidoc and see for yourself ;-).

Because I'm reading gmail on a tablet and don't have asciidoc. Always
describe the problem when posting, it may not happen anywhere but on
your system (see explanation below). Which version are you using on
which platform?

Problem
is that due to the greedy regex

Stuart will correct me if I'm wrong, but my reading of the regex reads
.*? which is non-greedy

You are right Lex.

The problem is not caused by greediness.

- The ` monospaced quotes are implemented as a passthrough macro (http://www.methods.co.nz/asciidoc/userguide.html#X77) not quoted text in the AsciiDoc sense (http://www.methods.co.nz/asciidoc/userguide.html#X51).

- The problem arises because inline passthrough macros are always processed before any other inline substitutions. If you were to define the no-inline-literal attribute (a backward compatibility attribute) then ` would be treated as quoted text instead of a passthrough and the example would work fine.

The change of ` to passthrough macro was added in AsciiDoc 8.4.1. From the 8.4.1 Changelog:

8<-----
Backtick quoting for monospaced text is now implemented as an inline literal passthrough. This makes more sense since monospace text is usually intended to be rendered literally. See Regression issues below for the impact this may have on existing documents. Here are some examples that would previously have had to be escaped:

The `++i` and `++j` auto-increments.
Paths `~/.vim` and `~/docs`.
The `__init__` method.
The `{id}` attribute.
8<-----

The lesson to take away is that the ` passthrough macro takes precedence over all other inline substitutions and is different semantically from + quoted text. The User Guide doesn't make this clear enough.


Cheers, Stuart


  the first backtick isn't matched with
the following apostrophe (to produce a single-quoted span), but extends
to the last backtick in the paragraph, producing a zombie monospaced span.


Michael

There are actually two problems:


1. Stuart has ignored his own advice and started two quote sequences
with the same character :-)  Since they are processed separately the
first one processed will always dominate the other.

2. the comment in asciidoc.conf is wrong, the quotes are not processed
in order in the file, they are processed in random order, determined
by the random order that dict.keys() returns the keys.

Cheers
Lex


--
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