diff --git a/markdown_include/include.py b/markdown_include/include.py index 8a039fa..5463cd5 100644 --- a/markdown_include/include.py +++ b/markdown_include/include.py @@ -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]