2.1 --- a/moinformat/parsers/table.py Tue Jul 17 23:27:57 2018 +0200
2.2 +++ b/moinformat/parsers/table.py Tue Jul 17 23:30:23 2018 +0200
2.3 @@ -22,7 +22,8 @@
2.4 from moinformat.parsers.common import get_patterns, \
2.5 excl, expect, group
2.6 from moinformat.parsers.moin import MoinParser
2.7 -from moinformat.tree import Table, TableAttrs, TableCell, TableRow, Text
2.8 +from moinformat.tree import Continuation, Table, TableAttrs, TableCell, \
2.9 + TableRow, Text
2.10
2.11 join = "".join
2.12
2.13 @@ -73,7 +74,11 @@
2.14 # Parser handler methods.
2.15
2.16 def parse_continuation(self, cell):
2.17 - pass
2.18 +
2.19 + "Handle continuation padding."
2.20 +
2.21 + feature = self.match_group("feature")
2.22 + cell.append(Continuation(feature))
2.23
2.24 def parse_table_end(self, cell):
2.25
2.26 @@ -99,17 +104,16 @@
2.27 excl(r".*==\s*?$"), # not-heading
2.28 expect(r"\N*?"))), # ws-excl-nl
2.29
2.30 - "continuation" : join(("^",
2.31 + "continuation" : group("feature",
2.32 + join(("^",
2.33 group("indent", r"\N*"), # ws... (optional)
2.34 r"\.\.", # ..
2.35 - excl(r"\."), # not-.
2.36 - expect(r"\N"))), # ws
2.37 + excl(r"\.")))), # not-.
2.38
2.39 # Within text:
2.40
2.41 "columnsep" : join((r"\|\|", # ||
2.42 - excl(r"\|"), # not-|
2.43 - expect(r"\N"))), # ws
2.44 + excl(r"\|"))), # not-|
2.45 })
2.46
2.47 patterns = get_patterns(syntax)
3.1 --- a/moinformat/serialisers/html.py Tue Jul 17 23:27:57 2018 +0200
3.2 +++ b/moinformat/serialisers/html.py Tue Jul 17 23:30:23 2018 +0200
3.3 @@ -211,6 +211,9 @@
3.4 def break_(self):
3.5 pass
3.6
3.7 + def continuation(self, text):
3.8 + pass
3.9 +
3.10 def rule(self, length):
3.11 self.out("<hr style='height: %dpt' />" % min(length, 10))
3.12
4.1 --- a/moinformat/serialisers/moin.py Tue Jul 17 23:27:57 2018 +0200
4.2 +++ b/moinformat/serialisers/moin.py Tue Jul 17 23:30:23 2018 +0200
4.3 @@ -172,6 +172,9 @@
4.4 def break_(self):
4.5 self.out("\n")
4.6
4.7 + def continuation(self, text):
4.8 + self.out(text)
4.9 +
4.10 def rule(self, length):
4.11 self.out("-" * length)
4.12
5.1 --- a/moinformat/tree.py Tue Jul 17 23:27:57 2018 +0200
5.2 +++ b/moinformat/tree.py Tue Jul 17 23:30:23 2018 +0200
5.3 @@ -151,6 +151,8 @@
5.4
5.5
5.6
5.7 +# Block nodes.
5.8 +
5.9 class Block(Container):
5.10
5.11 "A block in the page."
5.12 @@ -400,6 +402,8 @@
5.13
5.14
5.15
5.16 +# Inline nodes.
5.17 +
5.18 class Inline(Container):
5.19
5.20 "Generic inline formatting."
5.21 @@ -499,6 +503,8 @@
5.22
5.23
5.24
5.25 +# Nodes without children.
5.26 +
5.27 class Node:
5.28
5.29 "A document node without children."
5.30 @@ -519,6 +525,22 @@
5.31 def to_string(self, out):
5.32 out.break_()
5.33
5.34 +class Continuation(Node):
5.35 +
5.36 + "Continuation padding for table content."
5.37 +
5.38 + def __init__(self, text):
5.39 + self.text = text
5.40 +
5.41 + def __repr__(self):
5.42 + return "Continuation(%r)" % self.text
5.43 +
5.44 + def prettyprint(self, indent=""):
5.45 + return "%sContinuation: %r" % (indent, self.text)
5.46 +
5.47 + def to_string(self, out):
5.48 + out.continuation(self.text)
5.49 +
5.50 class Rule(Node):
5.51
5.52 "A horizontal rule."
7.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
7.2 +++ b/tests/test_continuation.txt Tue Jul 17 23:30:23 2018 +0200
7.3 @@ -0,0 +1,6 @@
7.4 +{{{#!table
7.5 +'''Release''' || '''Details'''
7.6 +==
7.7 +0.1 || [[http://hgweb.boddie.org.uk/Lichen/rev/rel-0-1|changeset]]
7.8 + .. [[http://hgweb.boddie.org.uk/Lichen/file/rel-0-1|files]]
7.9 +}}}