# HG changeset patch # User Paul Boddie # Date 1493996432 -7200 # Node ID a6a257ae57fbc7dba9d11e5fb9dcd9145ad8a0a6 # Parent 8dbedbb8ef8b60cb736e216f88acc364409380be Support inline formatting within table cells. diff -r 8dbedbb8ef8b -r a6a257ae57fb moinformat/__init__.py --- a/moinformat/__init__.py Fri May 05 00:10:27 2017 +0200 +++ b/moinformat/__init__.py Fri May 05 17:00:32 2017 +0200 @@ -139,6 +139,10 @@ "regionstart", "regionend", "rule", "tablerow", ] + table_region_pattern_names = inline_pattern_names + [ + "tableattrs", "tablecell", "tableend" + ] + def inline_patterns_for(self, name): names = self.inline_pattern_names[:] names[names.index(name)] = "%send" % name @@ -389,7 +393,7 @@ while True: cell = TableCell([]) - self.parse_region_details(items, cell, ["tableattrs", "tablecell", "tableend"]) + self.parse_region_details(items, cell, self.table_region_pattern_names) # Handle the end of the row. diff -r 8dbedbb8ef8b -r a6a257ae57fb tests/test12.txt --- a/tests/test12.txt Fri May 05 00:10:27 2017 +0200 +++ b/tests/test12.txt Fri May 05 17:00:32 2017 +0200 @@ -1,5 +1,5 @@ ||<20%|2-2)^> Cell 1 || Cell 2 || -|| Cell 3 ||<#FF0000 width="15%"> Cell 4 || +|| '''Cell 3''' ||<#FF0000 width="15%"> ''Cell 4'' || || Not a table || Also not a table