@@ -313,7 +313,7 @@ def process_text(self, el, parent_tags=None):
313313 if (should_remove_whitespace_outside (el .previous_sibling )
314314 or (should_remove_whitespace_inside (el .parent )
315315 and not el .previous_sibling )):
316- text = text .lstrip ()
316+ text = text .lstrip (' \t \r \n ' )
317317 if (should_remove_whitespace_outside (el .next_sibling )
318318 or (should_remove_whitespace_inside (el .parent )
319319 and not el .next_sibling )):
@@ -399,7 +399,7 @@ def convert_a(self, el, text, parent_tags):
399399
400400 def convert_blockquote (self , el , text , parent_tags ):
401401 # handle some early-exit scenarios
402- text = (text or '' ).strip ()
402+ text = (text or '' ).strip (' \t \r \n ' )
403403 if '_inline' in parent_tags :
404404 return ' ' + text + ' '
405405 if not text :
@@ -567,8 +567,8 @@ def _indent_for_li(match):
567567
568568 def convert_p (self , el , text , parent_tags ):
569569 if '_inline' in parent_tags :
570- return ' ' + text .strip () + ' '
571- text = text .strip ()
570+ return ' ' + text .strip (' \t \r \n ' ) + ' '
571+ text = text .strip (' \t \r \n ' )
572572 if self .options ['wrap' ]:
573573 # Preserve newlines (and preceding whitespace) resulting
574574 # from <br> tags. Newlines in the input have already been
@@ -577,7 +577,7 @@ def convert_p(self, el, text, parent_tags):
577577 lines = text .split ('\n ' )
578578 new_lines = []
579579 for line in lines :
580- line = line .lstrip ()
580+ line = line .lstrip (' \t \r \n ' )
581581 line_no_trailing = line .rstrip ()
582582 trailing = line [len (line_no_trailing ):]
583583 line = fill (line ,
0 commit comments