Skip to content

Commit

Permalink
Ensured new-line stripping can handle Windows format
Browse files Browse the repository at this point in the history
  • Loading branch information
cmacmackin authored Aug 20, 2020
1 parent 619b7e3 commit 6909343
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions markdown_include/include.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,13 @@ def run(self, lines):
# Strip the newline, and optionally increase header depth
if self.inheritHeadingDepth or self.headingOffset:
if HEADING_SYNTAX.search(text[i]):
text[i] = text[i].rstrip('\n')
text[i] = text[i].rstrip('\r\n')
if self.inheritHeadingDepth:
text[i] = bonusHeading + text[i]
if self.headingOffset:
text[i] = '#' * self.headingOffset + text[i]
else:
text[i] = text[i].rstrip('\n')
text[i] = text[i].rstrip('\r\n')

text[0] = line_split[0] + text[0]
text[-1] = text[-1] + line_split[2]
Expand Down

0 comments on commit 6909343

Please sign in to comment.