diff --git a/syntaxreference.txt b/syntaxreference.txt index 3e3ccf1..ea5bca2 100644 --- a/syntaxreference.txt +++ b/syntaxreference.txt @@ -147,6 +147,13 @@ line 1 indented 4 characters }}} += Tables = +== General table layout and HTML like options == +{{{ + ||cell 1||cell2||cell 3|| +}}} + ||cell 1||cell2||cell 3|| + = Rules = {{{ --- (not a rule) diff --git a/text_dokuwiki.py b/text_dokuwiki.py index e14c827..0682ebd 100644 --- a/text_dokuwiki.py +++ b/text_dokuwiki.py @@ -24,6 +24,7 @@ class Formatter(FormatterBase): self._current_depth = 1 self._base_depth = 0 self.in_pre = 0 + self.in_table = 0 self._text = None # XXX does not work with links in headings!!!!! self.list_depth = 0 @@ -149,6 +150,8 @@ class Formatter(FormatterBase): def paragraph(self, on, **kw): FormatterBase.paragraph(self, on) + if self.in_table: + return '' return ['', '\n\n'][not on] def linebreak(self, preformatted=1): @@ -164,13 +167,17 @@ class Formatter(FormatterBase): return u' %s' % (u'=' * heading_depth) def table(self, on, attrs={}, **kw): + if on: + self.in_table = 1 + else: + self.in_table = 0 return '' def table_row(self, on, attrs={}, **kw): - return ['|', ''][on] + return ['', '|'][not on] def table_cell(self, on, attrs={}, **kw): - return ['|', '|'][not on] + return ['|', ''][not on] def anchordef(self, id): # not supported