def markdown_2_rst(lines):
out = []<EOL>code = False<EOL>for line in lines:<EOL><INDENT>if line.strip() == "<STR_LIT>":<EOL><INDENT>code = not code<EOL>space = "<STR_LIT:U+0020>" * (len(line.rstrip()) - <NUM_LIT:3>)<EOL>if code:<EOL><INDENT>out.append("<STR_LIT>" % space)<EOL><DEDENT>else:<EOL><INDENT>out.append("<STR_LIT:\n>")<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if code and line.strip():<EOL><INDENT>line = "<STR_LIT:U+0020>" + line<EOL><DEDENT>else:<EOL><INDENT>line = line.replace("<STR_LIT:\\>", "<STR_LIT>")<EOL><DEDENT>out.append(line)<EOL><DEDENT><DEDENT>return out<EOL>
Convert markdown to restructured text