From a0fabfae06df0ff4ef9ad1277a9565aaea551ff6 Mon Sep 17 00:00:00 2001 From: Matt Singleton Date: Fri, 14 Jan 2022 18:55:59 -0600 Subject: handle leading spaces correctly for preformatted text --- fsm.py | 4 ++-- 1 file 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('
\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('
\n') self._offset += 1 -- cgit v1.2.3