def _fill_text(self, text, width, indent): text = (re.compile('\[quote\].*?\[\/quote\]', re.DOTALL).sub( lambda match: (match.group(0).replace('\n', '[QUOTE:NEWLINE]')), text)) text = '\n'.join( [indent + line for line in self._split_lines(text, width)]) text = (re.compile('\[quote\](.*?)\[\/quote\]', re.DOTALL).sub( lambda match: TERMINAL.green( match.group(1).replace('\n', ' ').replace( '[QUOTE:NEWLINE]', TERMINAL.normal + '\n ' + TERMINAL. green).rstrip(' ').strip('\n')), text)) return text
def _fill_text(self, text, width, indent): text = (re.compile('\[quote\].*?\[\/quote\]', re.DOTALL) .sub(lambda match: ( match.group(0) .replace('\n', '[QUOTE:NEWLINE]')), text)) text = '\n'.join([indent + line for line in self._split_lines(text, width)]) text = (re.compile('\[quote\](.*?)\[\/quote\]', re.DOTALL) .sub(lambda match: TERMINAL.green( match.group(1) .replace('\n', ' ') .replace('[QUOTE:NEWLINE]', TERMINAL.normal + '\n ' + TERMINAL.green) .rstrip(' ').strip('\n')), text)) return text