summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xasciidoc.py14
-rw-r--r--examples/website/index.txt4
-rw-r--r--html4.conf2
-rw-r--r--tests/data/testcases.txt1
-rw-r--r--xhtml11.conf2
5 files changed, 12 insertions, 11 deletions
diff --git a/asciidoc.py b/asciidoc.py
index 617c244..be54e6a 100755
--- a/asciidoc.py
+++ b/asciidoc.py
@@ -667,11 +667,13 @@ def filter_lines(filter_cmd, lines, attrs={}):
message.warning('no output from filter: %s' % filter_cmd)
return result
-def system(name, args, is_macro=False):
+def system(name, args, is_macro=False, attrs={}):
"""
Evaluate a system attribute ({name:args}) or system block macro
- (name::[args]). If is_macro is True then we are processing a system
- block macro otherwise it's a system attribute.
+ (name::[args]).
+ If is_macro is True then we are processing a system block macro otherwise
+ it's a system attribute.
+ The attrs dictionary is updated by the counter system attribute.
NOTE: The include1 attribute is used internally by the include1::[] macro
and is not for public use.
"""
@@ -756,7 +758,7 @@ def system(name, args, is_macro=False):
result = seed
else:
result = '1'
- document.attributes[attr] = result
+ document.attributes[attr] = attrs[attr] = result
elif name == 'include':
if not os.path.exists(args):
message.warning((syntax+': file does not exist') % (name,args))
@@ -937,12 +939,10 @@ def subs_attrs(lines, dictionary=None):
action = mo.group('action')
expr = expr.replace('{\\','{')
expr = expr.replace('}\\','}')
- s = system(action, expr)
+ s = system(action, expr, attrs=attrs)
if s is None:
skipped = True
break
- if action == 'counter':
- attrs[expr] = s
text = text[:mo.start()] + s + text[mo.end():]
pos = mo.start() + len(s)
# Drop line if the action returns None.
diff --git a/examples/website/index.txt b/examples/website/index.txt
index 05b4c0a..e4a2eaa 100644
--- a/examples/website/index.txt
+++ b/examples/website/index.txt
@@ -299,8 +299,8 @@ and I'll add them to the list.
have a customised contents sidebar).
- http://volnitsky.com/[Leonid Volnitsky's site] is generated using
AsciiDoc and includes Leonid's <<X5,matplotlib filter>>.
-- http://weechat.flashtux.org/[WeeChat] uses AsciiDoc for
- http://weechat.flashtux.org/doc.php[project documentation].
+- http://www.weechat.org/[WeeChat] uses AsciiDoc for
+ http://www.weechat.org/doc[project documentation].
Please let me know if any of these links need updating.
diff --git a/html4.conf b/html4.conf
index 545361e..08a9d5d 100644
--- a/html4.conf
+++ b/html4.conf
@@ -322,7 +322,7 @@ bodydata=<td {colspan@1::colspan="{colspan}" }{rowspan@1::rowspan="{rowspan}" }a
paragraph=
[table]
-<p><b>{caption={table_caption} {counter:table-number}: }</b>{title}</p>
+<p><b>{caption={table_caption} {counter:table_number}: }</b>{title}</p>
<a name="{id}"></a>
<table rules="{grid=all}"
{autowidth-option%}width="{tablepcwidth}%"
diff --git a/tests/data/testcases.txt b/tests/data/testcases.txt
index 4cdfe16..6bf4b9a 100644
--- a/tests/data/testcases.txt
+++ b/tests/data/testcases.txt
@@ -24,6 +24,7 @@ Hello *{author}* ({firstname} {lastname}, {authorinitials}).
{c1} = 1, {c2} = 99, {c3} = A
+{c1} {c2} {c3}
{counter:c1} {counter:c2:99} {counter:c3:A}
{c1} = 2, {c2} = 100, {c3} = B
diff --git a/xhtml11.conf b/xhtml11.conf
index 2543c0e..b8f3655 100644
--- a/xhtml11.conf
+++ b/xhtml11.conf
@@ -362,7 +362,7 @@ paragraph=
frame="{frame%border}"
frame="{frame@topbot:hsides}{frame@all:border}{frame@none:void}{frame@sides:vsides}"
cellspacing="0" cellpadding="4">
-<caption class="title">{caption={table_caption} {counter:table-number}: }{title}</caption>
+<caption class="title">{caption={table_caption} {counter:table_number}: }{title}</caption>
{colspecs}
{headrows#}<thead>
{headrows}