escaping double colons in variable list

35 views
Skip to first unread message

Suraj N. Kurapati

unread,
Aug 11, 2010, 1:38:19 AM8/11/10
to asciidoc
Hello,

I have a bibliography item that has 2 colons in its name:

------------------------------------------------------------------------------
[horizontal]
[[[Test::Unit]]]:: http://ruby-doc.org/stdlib/libdoc/test/unit/rdoc/classes/Test/Unit.html
------------------------------------------------------------------------------

AsciiDoc 8.5.3 renders this as (seen in web browser):

------------------------------------------------------------------------------
[]
http://ruby-doc.org/stdlib/libdoc/test/unit/rdoc/classes/Test/Unit.html
------------------------------------------------------------------------------

I am currently working around this problem by explicitly dropping an
anchor and putting the desired key name beside it:

------------------------------------------------------------------------------
[horizontal]
[[Test::Unit]] [Test::Unit]:: http://ruby-doc.org/stdlib/libdoc/test/unit/rdoc/classes/Test/Unit.html
------------------------------------------------------------------------------

This renders correctly in the web browser. But I am wondering, is
there a better way to escape the double colons inside the variable
list key name?

Thanks for your consideration.

Stuart Rackham

unread,
Aug 11, 2010, 8:48:55 AM8/11/10
to asci...@googlegroups.com

An AsciiDoc bibliographic anchor can only contain alphanumeric characters and
dashes. I cannot remember why that restriction was adopted since you are allowed
any ascii characters in the anchor name
(http://www.w3.org/TR/html401/struct/links.html#h-12.2.1). My understanding is
that in XHTML and DocBook the anchor id can be any valid XML name
(http://www.w3.org/TR/REC-xml/#NT-Name), correct me if I'm wrong. So underscore
and colon characters should also be allowed.


Cheers, Stuart


>
> Thanks for your consideration.
>

Stuart Rackham

unread,
Aug 11, 2010, 5:13:00 PM8/11/10
to asci...@googlegroups.com
I've relaxed the anchor ID name syntax in the trunk:
http://code.google.com/p/asciidoc/source/detail?r=4045be91f80e68bbfa294a2ef9ea13525d2718e3

Your example should now work.


Cheers, Stuart

On 11/08/10 17:38, Suraj N. Kurapati wrote:

Suraj Kurapati

unread,
Aug 11, 2010, 6:41:29 PM8/11/10
to asci...@googlegroups.com
On Wed, Aug 11, 2010 at 2:13 PM, Stuart Rackham <srac...@gmail.com> wrote:
> I've relaxed the anchor ID name syntax in the trunk:
> http://code.google.com/p/asciidoc/source/detail?r=4045be91f80e68bbfa294a2ef9ea13525d2718e3
>
> Your example should now work.

Thank you very much! I'll try to adjust the Vim syntax highlighting
to reflect this change also.

Stuart Rackham

unread,
Aug 11, 2010, 7:10:57 PM8/11/10
to asci...@googlegroups.com

Try attached patch.

Cheers, Stuart

>

syntax.patch

Suraj Kurapati

unread,
Aug 12, 2010, 1:19:04 AM8/12/10
to asci...@googlegroups.com
On Wed, Aug 11, 2010 at 4:10 PM, Stuart Rackham <srac...@gmail.com> wrote:
> On 12/08/10 10:41, Suraj Kurapati wrote:
>> On Wed, Aug 11, 2010 at 2:13 PM, Stuart Rackham  wrote:
>>> I've relaxed the anchor ID name syntax in the trunk:
>>
>> I'll try to adjust the Vim syntax highlighting to reflect this change
>
> Try attached patch.

Thanks for the patch, but I'm afraid it did not fix the highlighting:

[[[Test::Unit]]]:: http://...
^^^^^^ ^^
|||||| ||

The "::Unit" portion still appears in the same style as the "::" above.

This is a very minor problem, so please don't bother too much about it.

Stuart Rackham

unread,
Aug 12, 2010, 1:39:22 AM8/12/10
to asci...@googlegroups.com

On 12/08/10 17:19, Suraj Kurapati wrote:
> On Wed, Aug 11, 2010 at 4:10 PM, Stuart Rackham<srac...@gmail.com> wrote:
>> On 12/08/10 10:41, Suraj Kurapati wrote:
>>> On Wed, Aug 11, 2010 at 2:13 PM, Stuart Rackham wrote:
>>>> I've relaxed the anchor ID name syntax in the trunk:
>>>
>>> I'll try to adjust the Vim syntax highlighting to reflect this change
>>
>> Try attached patch.
>
> Thanks for the patch, but I'm afraid it did not fix the highlighting:
>
> [[[Test::Unit]]]:: http://...
> ^^^^^^ ^^
> |||||| ||
>
> The "::Unit" portion still appears in the same style as the "::" above.

Works for me with your example:

See attached screenshot.

Selection_001.png

Suraj Kurapati

unread,
Aug 12, 2010, 1:59:01 AM8/12/10
to asci...@googlegroups.com
On Wed, Aug 11, 2010 at 10:39 PM, Stuart Rackham <srac...@gmail.com> wrote:
> On 12/08/10 17:19, Suraj Kurapati wrote:
>> Thanks for the patch, but I'm afraid it did not fix the highlighting:
>>
>>   [[[Test::Unit]]]:: http://...
>>          ^^^^^^   ^^
>
> Works for me with your example:

You are correct. I did not install the syntax file correctly. Sorry.

Reply all
Reply to author
Forward
0 new messages