Remove a tab from the front of each line of the given text.
(self, text)
| 37 | return None |
| 38 | |
| 39 | def detab(self, text): |
| 40 | """ Remove a tab from the front of each line of the given text. """ |
| 41 | newtext = [] |
| 42 | lines = text.split('\n') |
| 43 | for line in lines: |
| 44 | if line.startswith(' '*markdown.TAB_LENGTH): |
| 45 | newtext.append(line[markdown.TAB_LENGTH:]) |
| 46 | elif not line.strip(): |
| 47 | newtext.append('') |
| 48 | else: |
| 49 | break |
| 50 | return '\n'.join(newtext), '\n'.join(lines[len(newtext):]) |
| 51 | |
| 52 | def looseDetab(self, text, level=1): |
| 53 | """ Remove a tab from front of lines but allowing dedented lines. """ |