2
0
Fork 0

Corrected the [quote][show][justify]hehe problem, still problems to go

This commit is contained in:
Thomas Touhey 2018-07-26 23:40:19 +02:00
parent f4ee519eb3
commit f162d1b94c
No known key found for this signature in database
GPG Key ID: 2ECEB0517AD947FB
1 changed files with 13 additions and 11 deletions

View File

@ -279,18 +279,18 @@ class Translator:
dat.last = True
continue
# Add the content to the preprocess buffer.
if not dat.raw:
text = process_func(text)
dat.last += text
# Start the tags if we're about to give this content to
# preprocessing.
if start_tags:
self.start_tags()
# Add the content to the preprocess buffer.
if not dat.raw:
text = process_func(text)
dat.last += text
break
else:
# No `break` has been encountered, which means the content has
@ -311,14 +311,15 @@ class Translator:
self.outp.write(message)
def put_code(self, code, start_tags = True,
def put_code(self, code, start_tags = True, flush_text = True,
superblocks_only = True, next_block_is_super = False):
""" Put some code. """
# We don't want to mix text and code, so we'll flush to be sure that
# the order doesn't get mixed up.
self.flush_text()
if flush_text:
self.flush_text()
# First of all, check if the text is empty or if we want to ignore it.
@ -559,7 +560,7 @@ class Translator:
continue
if hasattr(dat.tag, 'end'):
self.put_code(dat.tag.end(), False)
self.put_code(dat.tag.end(), start_tags = False)
dat.started = False
dat.reset()
@ -571,7 +572,8 @@ class Translator:
continue
if hasattr(dat.tag, 'begin'):
self.put_code(dat.tag.begin(), False)
self.put_code(dat.tag.begin(), start_tags = False,
flush_text = False)
dat.started = True
def close_inline_tags(self):
@ -585,7 +587,7 @@ class Translator:
continue
if hasattr(dat.tag, 'end'):
self.put_code(dat.tag.end(), False)
self.put_code(dat.tag.end(), start_tags = False)
dat.started = False
dat.reset()