Enforce l,ule or l,ole command order for RST

This commit is contained in:
Richard Berger
2016-09-07 01:31:56 -04:00
parent dfea11847f
commit 20839e280c
3 changed files with 20 additions and 1 deletions

View File

@ -347,6 +347,14 @@ class Txt2Rst(TxtParser):
def is_raw_textblock_end(self, line):
return line.startswith('END_RST -->')
def order_commands(self, commands):
if 'ule' in commands and 'l' in commands and commands.index('ule') > commands.index('l'):
return commands
elif 'ole' in commands and 'l' in commands and commands.index('ole') > commands.index('l'):
return commands
return super().order_commands(commands)
class Txt2RstConverter(TxtConverter):
def get_argument_parser(self):
parser = argparse.ArgumentParser(description='converts a text file with simple formatting & markup into '