# HG changeset patch # User Paul Boddie # Date 1562013020 -7200 # Node ID a0c28d5cff8fc2ac7f83772359596bb86f7bd673 # Parent 8143d4fd5760048b884289317ef899155578903a Changed horizontal rule handling to deal in heights not lengths. diff -r 8143d4fd5760 -r a0c28d5cff8f moinformat/parsers/moin.py --- a/moinformat/parsers/moin.py Mon Jul 01 22:23:25 2019 +0200 +++ b/moinformat/parsers/moin.py Mon Jul 01 22:30:20 2019 +0200 @@ -387,8 +387,8 @@ "Handle a horizontal rule within 'region'." - length = len(self.match_group("rule")) - rule = Rule(length) + height = len(self.match_group("rule")) - 4 + rule = Rule(height) self.add_node(region, rule) self.new_block(region) diff -r 8143d4fd5760 -r a0c28d5cff8f moinformat/serialisers/html/moin.py --- a/moinformat/serialisers/html/moin.py Mon Jul 01 22:23:25 2019 +0200 +++ b/moinformat/serialisers/html/moin.py Mon Jul 01 22:30:20 2019 +0200 @@ -321,8 +321,8 @@ key, value = key_value self.out("%s='%s'" % (key, escape_attr(value))) - def rule(self, length): - self.out("
" % min(length, 10)) + def rule(self, height): + self.out("
" % min(height, 10)) def table_attrs(self, nodes): diff -r 8143d4fd5760 -r a0c28d5cff8f moinformat/serialisers/moin/moin.py --- a/moinformat/serialisers/moin/moin.py Mon Jul 01 22:23:25 2019 +0200 +++ b/moinformat/serialisers/moin/moin.py Mon Jul 01 22:30:20 2019 +0200 @@ -199,8 +199,8 @@ else: self.out("=".join(key_value)) - def rule(self, length): - self.out("-" * length) + def rule(self, height): + self.out("-" * (height + 4)) def table_attrs(self, nodes): for node in nodes: diff -r 8143d4fd5760 -r a0c28d5cff8f moinformat/tree/moin.py --- a/moinformat/tree/moin.py Mon Jul 01 22:23:25 2019 +0200 +++ b/moinformat/tree/moin.py Mon Jul 01 22:30:20 2019 +0200 @@ -761,17 +761,17 @@ "A horizontal rule." - def __init__(self, length): - self.length = length + def __init__(self, height): + self.height = height def __repr__(self): - return "Rule(%d)" % self.length + return "Rule(%d)" % self.height def prettyprint(self, indent=""): - return "%sRule: length=%d" % (indent, self.length) + return "%sRule: height=%d" % (indent, self.height) def to_string(self, out): - out.rule(self.length) + out.rule(self.height) class TableAttr(Node):