1.1 --- a/moinformat/parsers/moin.py Sat Nov 24 18:10:14 2018 +0100
1.2 +++ b/moinformat/parsers/moin.py Sun Nov 25 16:57:15 2018 +0100
1.3 @@ -508,6 +508,9 @@
1.4
1.5
1.6 def inline_patterns_for(self, name):
1.7 +
1.8 + "Return active patterns for the inline element having the given 'name'."
1.9 +
1.10 names = self.inline_pattern_names[:]
1.11 names[names.index(name)] = "%send" % name
1.12 return names
1.13 @@ -721,14 +724,34 @@
1.14 # features.
1.15
1.16 "fontstyle" : group("style", repeat("'", 2, 6)), # ''...
1.17 - "larger" : r"~\+", # ~+
1.18 - "monospace" : r"`", # `
1.19 +
1.20 + # Trivial markup balancing is done below using the end features.
1.21 +
1.22 + "larger" : join((r"~\+", # ~+
1.23 + expect(r"\P*?\+~"))), # ... +~
1.24 +
1.25 + "monospace" : join((r"`", # `
1.26 + expect(r"\P*?`"))), # ... `
1.27 +
1.28 + "smaller" : join((r"~-", # ~-
1.29 + expect(r"\P*?-~"))), # ... -~
1.30 +
1.31 + "strike" : join((r"--\(", # --(
1.32 + expect(r"\P*?\)--"))), # ... )--
1.33 +
1.34 + "sub" : join((r",,", # ,,
1.35 + expect(r"\P*?,,"))), # ... ,,
1.36 +
1.37 + "super" : join((r"\^", # ^
1.38 + expect(r"\P*?\^"))), # ... ^
1.39 +
1.40 + "underline" : join((r"__", # __
1.41 + expect(r"\P*?__"))), # ... __
1.42 +
1.43 + # Rules are treated as inline but, unlike the above, appear without
1.44 + # contents.
1.45 +
1.46 "rule" : group("rule", "-----*"), # ----...
1.47 - "smaller" : r"~-", # ~-
1.48 - "strike" : r"--\(", # --(
1.49 - "sub" : r",,", # ,,
1.50 - "super" : r"\^", # ^
1.51 - "underline" : r"__", # __
1.52
1.53 # Links and transclusions may start inline spans.
1.54