summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart Rackham <srackham@methods.co.nz>2009-02-01 12:58:38 +1300
committerStuart Rackham <srackham@methods.co.nz>2009-02-01 12:58:38 +1300
commitd6288632cce6e219674c904ba5724dab83d9d044 (patch)
treebfd3a92fecaead08f001f2ca70e8952e47fe2b23
parentdb22785d109d15ae57f9861a673b79240c8b8d6b (diff)
downloadasciidoc-d6288632cce6e219674c904ba5724dab83d9d044.tar.gz
- Created distinct list definitions for each list style to allow nesting of all
styles. - Roman numbers in numbered lists are followed by a closing parenthesis instead of a period to eliminate i,v,x item ambiguity with respect to alpha numbered list items. - Added **, ***, ****, ***** bulleted lists. - Added ..., ...., ..... numbered lists. - Added :::, :::: labeled lists. - Optimized paragraph and list termination detection with separate precompiled re's for performance and to prevent reaching Python 100 group limit. - Tidied up some method and argument names. - Updated User Guide for new list syntaxes. - Updated Vim syntax highlighter for new list syntaxes.
-rw-r--r--asciidoc.conf95
-rwxr-xr-xasciidoc.py116
-rw-r--r--doc/asciidoc.txt122
-rw-r--r--vim/syntax/asciidoc.vim9
4 files changed, 231 insertions, 111 deletions
diff --git a/asciidoc.conf b/asciidoc.conf
index 66dda56..3fdf145 100644
--- a/asciidoc.conf
+++ b/asciidoc.conf
@@ -317,6 +317,7 @@ posattrs=style
# Lists
#-------
[listdef-bulleted]
+# - bullets.
delimiter=^\s*- +(?P<text>.+)$
posattrs=style
type=bulleted
@@ -324,24 +325,91 @@ tags=bulleted
callout-style=tags="callout"
bibliography-style=tags="bibliography"
-[listdef-bulleted2]
+[listdef-bulleted1]
+# * bullets.
template::[listdef-bulleted]
delimiter=^\s*\* +(?P<text>.+)$
-[listdef-numbered]
-delimiter=^\s*(?P<index>\d*)\. +(?P<text>.+)$
+[listdef-bulleted2]
+# ** bullets.
+template::[listdef-bulleted]
+delimiter=^\s*\*{2} +(?P<text>.+)$
+
+[listdef-bulleted3]
+# *** bullets.
+template::[listdef-bulleted]
+delimiter=^\s*\*{3} +(?P<text>.+)$
+
+[listdef-bulleted4]
+# **** bullets.
+template::[listdef-bulleted]
+delimiter=^\s*\*{4} +(?P<text>.+)$
+
+[listdef-bulleted5]
+# ***** bullets.
+template::[listdef-bulleted]
+delimiter=^\s*\*{5} +(?P<text>.+)$
+
+[listdef-arabic]
+# Arabic numbering.
+delimiter=^\s*(?P<index>\d+)\. +(?P<text>.+)$
posattrs=style
type=numbered
tags=numbered
style=arabic
-[listdef-numbered2]
-template::[listdef-numbered]
-delimiter=^\s*(?P<index>[.a-zA-Z]|[ivxIVX]+)\. +(?P<text>.+)$
+[listdef-loweralpha]
+# Lower alpha numbering.
+template::[listdef-arabic]
+delimiter=^\s*(?P<index>[a-z])\. +(?P<text>.+)$
style=loweralpha
+[listdef-upperalpha]
+# Upper alpha numbering.
+template::[listdef-arabic]
+delimiter=^\s*(?P<index>[A-Z])\. +(?P<text>.+)$
+style=upperalpha
+
+[listdef-lowerroman]
+# Lower roman numbering.
+template::[listdef-arabic]
+delimiter=^\s*(?P<index>[ivx]+)\) +(?P<text>.+)$
+style=lowerroman
+
+[listdef-upperroman]
+# Upper roman numbering.
+template::[listdef-arabic]
+delimiter=^\s*(?P<index>[IVX]+)\) +(?P<text>.+)$
+style=upperroman
+
+[listdef-numbered1]
+# . numbering.
+template::[listdef-arabic]
+delimiter=^\s*(?P<index>\.) +(?P<text>.+)$
+
+[listdef-numbered2]
+# .. numbering.
+template::[listdef-loweralpha]
+delimiter=^\s*(?P<index>\.{2}) +(?P<text>.+)$
+
+[listdef-numbered3]
+# ... numbering.
+template::[listdef-lowerroman]
+delimiter=^\s*(?P<index>\.{3}) +(?P<text>.+)$
+
+[listdef-numbered4]
+# .... numbering.
+template::[listdef-upperalpha]
+delimiter=^\s*(?P<index>\.{4}) +(?P<text>.+)$
+
+[listdef-numbered5]
+# ..... numbering.
+template::[listdef-upperroman]
+delimiter=^\s*(?P<index>\.{5}) +(?P<text>.+)$
+
[listdef-labeled]
-delimiter=^\s*(?P<label>.*\S)::(\s+(?P<text>.+))?$
+# label:: item.
+delimiter=^\s*(?P<label>.*[^:])::(\s+(?P<text>.+))?$
posattrs=style
type=labeled
tags=labeled
@@ -351,8 +419,19 @@ glossary-style=tags="glossary"
qanda-style=tags="qanda"
[listdef-labeled2]
+# label;; item.
+template::[listdef-labeled]
+delimiter=^\s*(?P<label>.*[^;]);;(\s+(?P<text>.+))?$
+
+[listdef-labeled3]
+# label::: item.
+template::[listdef-labeled]
+delimiter=^\s*(?P<label>.*[^:]):{3}(\s+(?P<text>.+))?$
+
+[listdef-labeled4]
+# label:::: item.
template::[listdef-labeled]
-delimiter=^\s*(?P<label>.*\S);;(\s+(?P<text>.+))?$
+delimiter=^\s*(?P<label>.*[^:]):{4}(\s+(?P<text>.+))?$
[listdef-callout]
posattrs=style
diff --git a/asciidoc.py b/asciidoc.py
index c5313f1..012b7d3 100755
--- a/asciidoc.py
+++ b/asciidoc.py
@@ -199,13 +199,13 @@ def strip_quotes(s):
s = s[1:-1]
return s
-def is_regexp(s):
+def is_re(s):
"""Return True if s is a valid regular expression else return False."""
try: re.compile(s)
except: return False
else: return True
-def join_regexp(relist):
+def re_join(relist):
"""Join list of regular expressions re1,re2,... to single regular
expression (re1)|(re2)|..."""
if len(relist) == 0:
@@ -825,7 +825,7 @@ def subs_attrs(lines, dictionary=None):
if len(v) not in (2,3):
error('illegal attribute syntax: %s' % attr)
s = ''
- elif not is_regexp('^'+v[0]+'$'):
+ elif not is_re('^'+v[0]+'$'):
error('illegal attribute regexp: %s' % attr)
s = ''
else:
@@ -1061,7 +1061,7 @@ class Document:
self.has_errors = False # Set true if processing errors were flagged.
self.has_warnings = False # Set true if warnings were flagged.
self.safe = True # Default safe mode.
- def init_attrs(self):
+ def update_attributes(self):
# Set implicit attributes.
d = time.localtime(time.time())
self.attributes['localdate'] = time.strftime('%Y-%m-%d',d)
@@ -1418,12 +1418,13 @@ class AttributeList:
def __init__(self):
raise AssertionError,'no class instances allowed'
@staticmethod
+ def initialize():
+ if not 'attributelist-pattern' in document.attributes:
+ error("[attributes] missing 'attributelist-pattern' entry")
+ AttributeList.pattern = document.attributes['attributelist-pattern']
+ @staticmethod
def isnext():
result = False # Assume not next.
- if not AttributeList.pattern:
- if not 'attributelist-pattern' in document.attributes:
- error("[attributes] missing 'attributelist-pattern' entry")
- AttributeList.pattern = document.attributes['attributelist-pattern']
line = reader.read_next()
if line:
mo = re.match(AttributeList.pattern, line)
@@ -1610,13 +1611,13 @@ class Title:
Title.dump_dict['subs'] = entries['subs']
if 'sectiontitle' in entries:
pat = entries['sectiontitle']
- if not pat or not is_regexp(pat):
+ if not pat or not is_re(pat):
raise EAsciiDoc,'malformed [titles] sectiontitle entry'
Title.pattern = pat
Title.dump_dict['sectiontitle'] = pat
if 'blocktitle' in entries:
pat = entries['blocktitle']
- if not pat or not is_regexp(pat):
+ if not pat or not is_re(pat):
raise EAsciiDoc,'malformed [titles] blocktitle entry'
BlockTitle.pattern = pat
Title.dump_dict['blocktitle'] = pat
@@ -1624,7 +1625,7 @@ class Title:
for k in ('sect0','sect1','sect2','sect3','sect4'):
if k in entries:
pat = entries[k]
- if not pat or not is_regexp(pat):
+ if not pat or not is_re(pat):
raise EAsciiDoc,'malformed [titles] %s entry' % k
Title.dump_dict[k] = pat
# TODO: Check we have either a Title.pattern or at least one
@@ -1862,7 +1863,7 @@ class AbstractBlock:
v = parse_options(v, SUBS_OPTIONS, msg % (k,v))
copy(dst,k,v)
elif k == 'delimiter':
- if v and is_regexp(v):
+ if v and is_re(v):
copy(dst,k,v)
else:
raise EAsciiDoc, msg % (k,v)
@@ -2066,7 +2067,7 @@ class AbstractBlocks:
self.current=None
self.blocks = [] # List of Block objects.
self.default = None # Default Block.
- self.delimiter = None # Combined tables delimiter regular expression.
+ self.delimiters = None # Combined tables delimiter regular expression.
def load(self,sections):
"""Load block definition from 'sections' dictionary."""
for k in sections.keys():
@@ -2101,12 +2102,12 @@ class AbstractBlocks:
b.validate()
if b.delimiter:
delimiters.append(b.delimiter)
- self.delimiter = join_regexp(delimiters)
+ self.delimiters = re_join(delimiters)
class Paragraph(AbstractBlock):
def __init__(self):
AbstractBlock.__init__(self)
- self.text=None # Text in first line of paragraph.
+ self.text=None # Text in first line of paragraph.
def load(self,name,entries):
AbstractBlock.load(self,name,entries)
def dump(self):
@@ -2126,11 +2127,7 @@ class Paragraph(AbstractBlock):
AttributeList.consume(attrs)
self.merge_attributes(attrs)
reader.read() # Discard (already parsed item first line).
- body = reader.read_until(r'^\+$|^$|' + blocks.delimiter
- + r'|' + tables.delimiter
- + r'|' + tables_OLD.delimiter
- + r'|' + AttributeList.pattern
- )
+ body = reader.read_until(paragraphs.terminators)
body = [self.text] + list(body)
presubs = self.parameters.presubs
postsubs = self.parameters.postsubs
@@ -2150,6 +2147,15 @@ class Paragraphs(AbstractBlocks):
PREFIX = 'paradef-'
def __init__(self):
AbstractBlocks.__init__(self)
+ self.terminators=None # List of compiled re's.
+ def initialize(self):
+ self.terminators = [
+ re.compile(r'^\+$|^$'),
+ re.compile(AttributeList.pattern),
+ re.compile(blocks.delimiters),
+ re.compile(tables.delimiters),
+ re.compile(tables_OLD.delimiters),
+ ]
def load(self,sections):
AbstractBlocks.load(self,sections)
def validate(self):
@@ -2224,12 +2230,7 @@ class List(AbstractBlock):
itemtag = subs_tag(self.tag.item, self.attributes)
writer.write(itemtag[0])
# Write ItemText.
- text = reader.read_until(
- lists.delimiter + r'|^\+$|^$|' + blocks.delimiter
- + r'|' + tables.delimiter
- + r'|' + tables_OLD.delimiter
- + r'|' + AttributeList.pattern
- )
+ text = reader.read_until(lists.terminators)
if self.text:
text = [self.text] + list(text)
if text:
@@ -2263,7 +2264,8 @@ class List(AbstractBlock):
@staticmethod
def parse_index(index):
"""Parse the numbered list item index and return a (style,ordinal)
- tuple. style in ('arabic'...); ordinal in (1...).
+ tuple. style in ('arabic'...); ordinal in (1...). Return (None,None) if
+ the index does not match a recognized style.
NOTE: 'i' and 'I' return (1,'lowerroman') and (1,'upperroman')."""
def roman_to_int(roman):
roman = roman.lower()
@@ -2390,6 +2392,16 @@ class Lists(AbstractBlocks):
AbstractBlocks.__init__(self)
self.open = [] # A stack of the current and parent lists.
self.tags={} # List tags dictionary. Each entry is a tags AttrDict.
+ self.terminators=None # List of compiled re's.
+ def initialize(self):
+ self.terminators = [
+ re.compile(r'^\+$|^$'),
+ re.compile(AttributeList.pattern),
+ re.compile(lists.delimiters),
+ re.compile(blocks.delimiters),
+ re.compile(tables.delimiters),
+ re.compile(tables_OLD.delimiters),
+ ]
def load(self,sections):
AbstractBlocks.load(self,sections)
self.load_tags(sections)
@@ -2576,7 +2588,7 @@ class Table(AbstractBlock):
self.error('illegal csv separator=%s' % separator)
separator = ','
else:
- if not is_regexp(separator):
+ if not is_re(separator):
self.error('illegal regular expression: separator=%s' %
separator)
self.parameters.format = format
@@ -3104,7 +3116,7 @@ class Macro:
e = parse_entry(entry)
if not e:
raise EAsciiDoc,'malformed macro entry: %s' % entry
- if not is_regexp(e[0]):
+ if not is_re(e[0]):
raise EAsciiDoc,'illegal macro regular expression: %s' % e[0]
pattern, name = e
if name and name[0] in ('+','#'):
@@ -3571,22 +3583,29 @@ class Reader(Reader1):
return tuple(result)
def skip_blank_lines(self):
reader.read_until(r'\s*\S+')
- def read_until(self,pattern,same_file=False):
+ def read_until(self,terminators,same_file=False):
"""Like read() but reads lines up to (but not including) the first line
- that matches the pattern regular expression. If same_file is True
- then the terminating pattern must occur in the file the was being read
- when the routine was called."""
+ that matches the terminator regular expression, regular expression
+ object or list of regular expression objects. If same_file is True then
+ the terminating pattern must occur in the file the was being read when
+ the routine was called."""
if same_file:
fname = self.cursor[0]
result = []
- reo = re.compile(pattern)
+ if not isinstance(terminators,list):
+ if isinstance(terminators,basestring):
+ terminators = [re.compile(terminators)]
+ else:
+ terminators = [terminators]
while not self.eof():
save_cursor = self.cursor
s = self.read()
- if (not same_file or fname == self.cursor[0]) and reo.match(s):
- self.unread(self.cursor)
- self.cursor = save_cursor
- break
+ if not same_file or fname == self.cursor[0]:
+ for reo in terminators:
+ if reo.match(s):
+ self.unread(self.cursor)
+ self.cursor = save_cursor
+ return tuple(result)
result.append(s)
return tuple(result)
# NOT USED -- part of unimplemented attempt a generalised line continuation.
@@ -3815,7 +3834,7 @@ class Config:
allow_name_only=True)
update_attrs(self.conf_attrs,d)
# Update document attributes so they are available immediately.
- document.init_attrs()
+ document.update_attributes()
d = {}
parse_entries(sections.get('titles',()),d)
Title.load(d)
@@ -4034,7 +4053,7 @@ class Config:
parse_entries(self.sections.get('specialsections',()),d,unquote=True)
for pat,sectname in d.items():
pat = strip_quotes(pat)
- if not is_regexp(pat):
+ if not is_re(pat):
raise EAsciiDoc,'[specialsections] entry ' \
'is not a valid regular expression: %s' % pat
if sectname is None:
@@ -4056,7 +4075,7 @@ class Config:
def set_replacement(pat, rep, replacements):
"""Add pattern and replacement to replacements dictionary."""
pat = strip_quotes(pat)
- if not is_regexp(pat):
+ if not is_re(pat):
return False
if rep is None:
if pat in replacements:
@@ -4093,7 +4112,7 @@ class Config:
words = reo.findall(wordlist)
for word in words:
word = strip_quotes(word)
- if not is_regexp(word):
+ if not is_re(word):
raise EAsciiDoc,'[specialwords] entry in %s ' \
'is not a valid regular expression: %s' \
% (self.fname,word)
@@ -4133,7 +4152,7 @@ class Config:
if mo:
s = mo.group('attrlist')
if s in self.sections:
- result += self.sections[s]
+ result += self.expand_templates(self.sections[s])
else:
warning('missing [%s] section' % s)
else:
@@ -4673,7 +4692,7 @@ class Tables_OLD(AbstractBlocks):
b.headdata = b.bodydata
if not b.footdata:
b.footdata = b.bodydata
- self.delimiter = join_regexp(delimiters)
+ self.delimiters = re_join(delimiters)
# Check table definitions are valid.
for b in self.blocks:
b.validate()
@@ -4723,7 +4742,7 @@ def asciidoc(backend, doctype, confiles, infile, outfile, options):
warning('non-standard %s backend' % backend, linenos=False)
document.doctype = doctype
document.infile = infile
- document.init_attrs()
+ document.update_attributes()
# Set processing options.
for o in options:
if o == '-c': config.dumping = True
@@ -4754,7 +4773,7 @@ def asciidoc(backend, doctype, confiles, infile, outfile, options):
config.load_file(conf)
else:
raise EAsciiDoc,'configuration file %s missing' % conf
- document.init_attrs() # Add conf files.
+ document.update_attributes()
# Check configuration for consistency.
config.validate()
# Build outfile name now all conf files have been read.
@@ -4773,7 +4792,10 @@ def asciidoc(backend, doctype, confiles, infile, outfile, options):
writer.newline = config.newline
writer.open(outfile)
try:
- document.init_attrs() # Add file name related entries.
+ AttributeList.initialize()
+ paragraphs.initialize()
+ lists.initialize()
+ document.update_attributes() # Add file name related.
document.translate()
finally:
writer.close()
diff --git a/doc/asciidoc.txt b/doc/asciidoc.txt
index f05251a..4f3f307 100644
--- a/doc/asciidoc.txt
+++ b/doc/asciidoc.txt
@@ -1379,53 +1379,77 @@ Lists
is the number of items in the most recently closed list. Useful for
displaying the number of items in a list.
-Bulleted and Numbered Lists
-~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Bulleted list items start with a dash or an asterisk followed by a
-space or tab character. Bulleted list syntaxes are:
+Bulleted Lists
+~~~~~~~~~~~~~~
+Bulleted list items start with a single dash or one to five asterisks
+followed by some white space then some text. Bulleted list syntaxes
+are:
...................
- List item.
* List item.
+** List item.
+*** List item.
+**** List item.
+***** List item.
...................
-There are two numbered list item syntaxes:
+Numbered Lists
+~~~~~~~~~~~~~~
+List item numbers are explicit or implicit.
-. List items beginning with a single period followed by a space. The
- period can be preceded by an optional decimal number. The default
- numbering style is arabic (decimal).
-. List items beginning with two periods followed by a space. An alpha
- character or a roman number (upper or lower case) can optionally be
- used in place of the first period:
- * An attempt is made to set the number style based on number style
- of the first list item.
- * The default numbering style is lowercase alpha.
+.Explicit numbering
+List items begin with a number followed by some white space then the
+item text. The numbers can be decimal (arabic), roman (upper or lower
+case) or alpha (upper or lower case). Decimal and alpha numbers are
+terminated with a period, roman numbers are terminated with a closing
+parenthesis. The different terminators are necessary to ensure 'i',
+'v' and 'x' roman numbers are are distinguishable from 'x', 'v' and
+'x' alpha numbers. Examples:
-You can use the 'style' attribute to specify an alternative numbering
-style. The numbered list style can be set to one of the following
-values: 'arabic', 'loweralpha', 'upperalpha', 'lowerroman',
-'upperroman'.
+.....................................................................
+1. Arabic (decimal) numbered list item.
+a. Lower case alpha (letter) numbered list item.
+F. Upper case alpha (letter) numbered list item.
+iii) Lower case roman numbered list item.
+IX) Upper case roman numbered list item.
+.....................................................................
-Examples of numbered list items:
+.Implicit numbering
+List items begin one to five period characters, followed by some white
+space then the item text. Examples:
.....................................................................
-. Arabic (decimal) numbered list item.
-1. Arabic (decimal) numbered list item.
-.. Lower case letter numbered list item.
-a. Lower case letter numbered list item.
-A. Upper case letter numbered list item.
-iii. Lower case roman numbered list item.
-IX. Upper case roman numbered list item.
+. Arabic (decimal) numbered list item.
+.. Lower case alpha (letter) numbered list item.
+... Lower case roman numbered list item.
+.... Upper case alpha (letter) numbered list item.
+..... Upper case roman numbered list item.
.....................................................................
+You can use the 'style' attribute to specify an alternative numbering
+style. The numbered list style can be one of the following values:
+'arabic', 'loweralpha', 'upperalpha', 'lowerroman', 'upperroman'.
+
Here are some examples of bulleted and numbered lists:
+
---------------------------------------------------------------------
+- Praesent eget purus quis magna eleifend eleifend.
+ 1. Fusce euismod commodo velit.
+ a. Fusce euismod commodo velit.
+ b. Vivamus fringilla mi eu lacus.
+ c. Donec eget arcu bibendum nunc consequat lobortis.
+ 2. Vivamus fringilla mi eu lacus.
+ i) Fusce euismod commodo velit.
+ ii) Vivamus fringilla mi eu lacus.
+ 3. Donec eget arcu bibendum nunc consequat lobortis.
+ 4. Nam fermentum mattis ante.
- Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
* Fusce euismod commodo velit.
- * Qui in magna commodo, est labitur dolorum an. Est ne magna primis
- adolescens. Sit munere ponderum dignissim et. Minim luptatum et
- vel.
- * Vivamus fringilla mi eu lacus.
+ ** Qui in magna commodo, est labitur dolorum an. Est ne magna primis
+ adolescens. Sit munere ponderum dignissim et. Minim luptatum et
+ vel.
+ ** Vivamus fringilla mi eu lacus.
* Donec eget arcu bibendum nunc consequat lobortis.
- Nulla porttitor vulputate libero.
. Fusce euismod commodo velit.
@@ -1434,26 +1458,26 @@ Here are some examples of bulleted and numbered lists:
.. Fusce euismod commodo velit.
.. Vivamus fringilla mi eu lacus.
. Donec eget arcu bibendum nunc consequat lobortis.
+---------------------------------------------------------------------
+
+Which render as:
+
- Praesent eget purus quis magna eleifend eleifend.
1. Fusce euismod commodo velit.
a. Fusce euismod commodo velit.
b. Vivamus fringilla mi eu lacus.
c. Donec eget arcu bibendum nunc consequat lobortis.
2. Vivamus fringilla mi eu lacus.
- .. Fusce euismod commodo velit.
- .. Vivamus fringilla mi eu lacus.
+ i) Fusce euismod commodo velit.
+ ii) Vivamus fringilla mi eu lacus.
3. Donec eget arcu bibendum nunc consequat lobortis.
4. Nam fermentum mattis ante.
----------------------------------------------------------------------
-
-Which render as:
-
- Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
* Fusce euismod commodo velit.
- * Qui in magna commodo, est labitur dolorum an. Est ne magna primis
- adolescens. Sit munere ponderum dignissim et. Minim luptatum et
- vel.
- * Vivamus fringilla mi eu lacus.
+ ** Qui in magna commodo, est labitur dolorum an. Est ne magna primis
+ adolescens. Sit munere ponderum dignissim et. Minim luptatum et
+ vel.
+ ** Vivamus fringilla mi eu lacus.
* Donec eget arcu bibendum nunc consequat lobortis.
- Nulla porttitor vulputate libero.
. Fusce euismod commodo velit.
@@ -1462,16 +1486,6 @@ Which render as:
.. Fusce euismod commodo velit.
.. Vivamus fringilla mi eu lacus.
. Donec eget arcu bibendum nunc consequat lobortis.
-- Praesent eget purus quis magna eleifend eleifend.
- 1. Fusce euismod commodo velit.
- a. Fusce euismod commodo velit.
- b. Vivamus fringilla mi eu lacus.
- c. Donec eget arcu bibendum nunc consequat lobortis.
- 2. Vivamus fringilla mi eu lacus.
- .. Fusce euismod commodo velit.
- .. Vivamus fringilla mi eu lacus.
- 3. Donec eget arcu bibendum nunc consequat lobortis.
- 4. Nam fermentum mattis ante.
A predefined 'compact' option is available to bulleted and numbered
lists -- this translates to the DocBook 'spacing="compact"' lists
@@ -1492,8 +1506,8 @@ Labeled list items consist of one or more text labels followed the
text of the list item.
An item label begins a line with an alphanumeric character hard
-against the left margin and ends with a double colon `::` or
-semi-colon `;;`. A list item can have multiple labels, one per line.
+against the left margin and ends with one to four colons or two
+semi-colons. A list item can have multiple labels, one per line.
The list item text consists of one or more lines of text starting
after the last label (either on the same line or a new line) and can
@@ -1520,6 +1534,8 @@ Dolor::
Pretium nulla vel lorem.
In;;
Dictum mauris in urna.
+ Vivamus::: Fringilla mi eu lacus.
+ Donec::: Eget arcu bibendum nunc consequat lobortis.
---------------------------------------------------------------------
Which render as:
@@ -1541,6 +1557,8 @@ Dolor::
Pretium nulla vel lorem.
In;;
Dictum mauris in urna.
+ Vivamus::: Fringilla mi eu lacus.
+ Donec::: Eget arcu bibendum nunc consequat lobortis.
Horizontal labeled list style
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/vim/syntax/asciidoc.vim b/vim/syntax/asciidoc.vim
index c9d75ae..56fa621 100644
--- a/vim/syntax/asciidoc.vim
+++ b/vim/syntax/asciidoc.vim
@@ -30,8 +30,6 @@ syn match asciidocEntityRef /\\\@<!&[#a-zA-Z]\S\{-};/
" preceeded by blank line, handles only bulleted items (see 'Limitations' above
" for workarounds).
syn region asciidocLiteralParagraph start=/^\n[ \t]\+\(\([^-*. \t] \)\|\(\S\S\)\)/ end=/\(^+\?\s*$\)\@=/
-syn match asciidocListBullet /^\s*\zs[-*]\ze\s/
-syn match asciidocListNumber /^\s*\zs\(\(\d\+\.\)\|\.\{1,2}\|\(\a\.\)\|\([ivxIVX]\+\.\)\)\ze\s\+/
syn match asciidocURL /\\\@<!\<\(http\|https\|ftp\|file\|irc\):\/\/[^| \t]*\(\w\|\/\)/
syn match asciidocEmail /\\\@<!\(\<\|<\)\w\(\w\|[.-]\)*@\(\w\|[.-]\)*\w>\?[0-9A-Za-z_.]\@!/
syn match asciidocAttributeRef /\\\@<!{\w\(\w\|-\)*\([=!@#$%?:].*\)\?}/
@@ -57,6 +55,9 @@ syn match asciidocQuotedDoubleQuoted /\(^\|[| \t([.,=]\)\@<=``\([ )\n]\)\@!\_.\{
syn match asciidocDoubleDollarPassthrough /\\\@<!\(^\|[^0-9a-zA-Z$]\)\@<=\$\$..\{-}\(\$\$\([^0-9a-zA-Z$]\|$\)\@=\|^$\)/
syn match asciidocTriplePlusPassthrough /\\\@<!\(^\|[^0-9a-zA-Z$]\)\@<=+++..\{-}\(+++\([^0-9a-zA-Z$]\|$\)\@=\|^$\)/
+syn match asciidocListBullet /^\s*\zs\(-\|\*\{1,5}\)\ze\s/
+syn match asciidocListNumber /^\s*\zs\(\(\d\+\.\)\|\.\{1,5}\|\(\a\.\)\|\([ivxIVX]\+)\)\)\ze\s\+/
+
syn region asciidocTable_OLD start=/^\([`.']\d*[-~_]*\)\+[-~_]\+\d*$/ end=/^$/
syn match asciidocBlockTitle /^\.[^. \t].*[^-~_]$/ contains=asciidocQuoted.*,asciidocAttributeRef
syn match asciidocOneLineTitle /^=\{1,5}\s\+\S.*$/ contains=asciidocQuoted.*,asciidocAttributeRef
@@ -78,7 +79,7 @@ syn region asciidocTableBlock2 matchgroup=asciidocTableDelimiter2 start=/^!=\{3,
syn match asciidocListContinuation /^+$/
syn region asciidocLiteralBlock start=/^\.\{4,}$/ end=/^\.\{4,}$/ contains=asciidocCallout keepend
-syn region asciidocListingBlock start=/^-\{4,}$/ end=/^-\{4,}$/ contains=asciidocCallout keepend
+syn region asciidocOpenBlock start=/^-\{4,}$/ end=/^-\{4,}$/ contains=asciidocCallout keepend
syn region asciidocCommentBlock start="^/\{4,}$" end="^/\{4,}$" contains=asciidocToDo
syn region asciidocPassthroughBlock start="^+\{4,}$" end="^+\{4,}$"
" Allowing leading \w characters in the filter delimiter is to accomodate
@@ -132,7 +133,7 @@ highlight link asciidocQuoteBlockDelimiter Type
highlight link asciidocExampleBlockDelimiter Type
highlight link asciidocSidebarDelimiter Type
highlight link asciidocLiteralBlock Identifier
-highlight link asciidocListingBlock Identifier
+highlight link asciidocOpenBlock Identifier
highlight link asciidocPassthroughBlock Identifier
highlight link asciidocCommentBlock Comment
highlight link asciidocFilterBlock Type