summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Singleton <matt@xcolour.net>2022-01-14 18:55:59 -0600
committerMatt Singleton <matt@xcolour.net>2022-01-16 13:04:41 -0600
commita0fabfae06df0ff4ef9ad1277a9565aaea551ff6 (patch)
tree4c7985fd1942ef6ab9a8b412179b80a926ddf037
parent49060525e94e9c6c6d0b412099d4fc8cb8b217dd (diff)
handle leading spaces correctly for preformatted text
-rw-r--r--fsm.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/fsm.py b/fsm.py
index 901e114..963aa0a 100644
--- a/fsm.py
+++ b/fsm.py
@@ -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