Good catch! This is due to an incorrect regular expression for matching
callout lists.
The delimiter regex in the list definition matches 0 or more numbers in
front of a greater than sign:
[listdef-callout]
posattrs=style
delimiter=^<?(?P<index>\d*>) +(?P<text>.+)$
type=callout
tags=callout
style=arabic
But in the asciidoc.py script, the regular expression expects there to be
at least one number:
if re.match(r'^\d+[\.>]$', index):
style = 'arabic'
The asterisk in the listdef-callout delimiter regexp should be changed to a
plus.
delimiter=^<?(?P<index>\d+>) +(?P<text>.+)$
Can you file an issue in the AsciiDoc issue tracker?
-Dan
On Sat, May 25, 2013 at 11:13 AM, Tong Sun <[email protected]> wrote:
> Hi,
>
> I get this weird "asciidoc: FAILED: unexpected error" today from my long
> document.
>
> Took me quit some time playing trial-and-error to find where
> that unexpected error coming from, because it comes from the place that I
> least expected -- it looks perfectly fine to me.
>
> Here it is, trimmed down to the very least to show the problem:
>
>
> - - - >8 - - - >8 - - - >8 - - - >8 - - - >8 - - -
>
> == test
>
> > So I found the glimpse dsc file at +
> > ftp://ftp.cstone.net/debian/pool/non-free/g/glimpse/glimpse_4.18.5-1.dsc
>
>
> Something else
> - - - >8 - - - >8 - - - >8 - - - >8 - - - >8 - - -
>
> $ asciidoc $test.adoc
> asciidoc: FAILED: 2341.tmpf.2549.adoc: line 3: unexpected error:
> asciidoc: ------------------------------------------------------------
> Traceback (most recent call last):
> File "/usr/bin/asciidoc", line 6015, in asciidoc
> document.translate(has_header) # Generate the output.
> File "/usr/bin/asciidoc", line 1662, in translate
> Section.translate()
> File "/usr/bin/asciidoc", line 2306, in translate
> Section.translate_body()
> File "/usr/bin/asciidoc", line 2314, in translate_body
> next.translate()
> File "/usr/bin/asciidoc", line 2934, in translate
> attrs['style'] = self.calc_style(self.index)
> File "/usr/bin/asciidoc", line 2867, in calc_style
> assert False
> AssertionError
> asciidoc: ------------------------------------------------------------
>
> So what's the problem?
>
> Thanks
>
> PS, my asciidoc:
>
> $ apt-cache policy asciidoc
> asciidoc:
> Installed: 8.6.7-1
> Candidate: 8.6.7-1
> Version table:
> *** 8.6.7-1 0
> 500 http://us.archive.ubuntu.com/ubuntu/ raring/main amd64
> Packages
> 100 /var/lib/dpkg/status
>
> --
> You received this message because you are subscribed to the Google Groups
> "asciidoc" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/asciidoc?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
--
Dan Allen | http://google.com/profiles/dan.j.allen
--
You received this message because you are subscribed to the Google Groups
"asciidoc" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/asciidoc?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.