diff options
author | Matt Singleton <matt@xcolour.net> | 2022-01-14 18:55:59 -0600 |
---|---|---|
committer | Matt Singleton <matt@xcolour.net> | 2022-01-16 13:04:41 -0600 |
commit | a0fabfae06df0ff4ef9ad1277a9565aaea551ff6 (patch) | |
tree | 4c7985fd1942ef6ab9a8b412179b80a926ddf037 | |
parent | 49060525e94e9c6c6d0b412099d4fc8cb8b217dd (diff) |
handle leading spaces correctly for preformatted text
-rw-r--r-- | fsm.py | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -50,7 +50,7 @@ class Parser(object): self._blanks += 1 else: self._blanks = 0 - if line.strip() == '```': + if line.startswith('```'): self._fsm.push_state(self.pre_state) self._output.write('<pre>\n') self._offset += 1 @@ -78,7 +78,7 @@ class Parser(object): def pre_state(self): line = self._document[self._offset] - if line.strip() == '```': + if line.startswith('```'): self._fsm.pop_state() self._output.write('</pre>\n') self._offset += 1 |