summaryrefslogtreecommitdiff
path: root/wikitrans/wikimarkup.py
diff options
context:
space:
mode:
Diffstat (limited to 'wikitrans/wikimarkup.py')
-rw-r--r--wikitrans/wikimarkup.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/wikitrans/wikimarkup.py b/wikitrans/wikimarkup.py
index 0ce0e15..19f69e6 100644
--- a/wikitrans/wikimarkup.py
+++ b/wikitrans/wikimarkup.py
@@ -256,22 +256,26 @@ class WikiMarkupParser(object):
tag=m.group('tag')))
except TagAttributeSyntaxError:
yield(self._new_node(type='TEXT',
content=m.group(0)))
continue
else:
- yield(self._new_node(type='TEXT', content=m.group(0)))
+ yield(self._new_node(type='TEXT',
+ content=m.group(0)))
continue
else:
m = self.ctag.match(line, pos)
if m:
if m.group('tag') in self.tags:
yield(self._new_node(type='CTAG',
tag=m.group('tag')))
- pos = m.end(0)
- continue
+ else:
+ yield(self._new_node(type='TEXT',
+ content=m.group(0)))
+ pos = m.end(0)
+ continue
else:
yield(self._new_node(type='TEXT',
content=line[pos:pos+1]))
pos += 1
continue
else:
@@ -367,13 +371,15 @@ class WikiMarkupParser(object):
stack.append(i)
else:
# Push the token on stack
stack.append(i)
# Redefine all non-matched tokens as TEXT
for i in stack:
- self.toklist[i].type = 'TEXT' # FIXME
+ # FIXME
+ self.toklist[i] = self._new_node(type='TEXT',
+ content=str(self.toklist[i]))
mark = []
def push_mark(self):
"""Save the current token index on stack."""
self.mark.append(self.tokind)

Return to:

Send suggestions and report system problems to the System administrator.