Skip to content
This repository was archived by the owner on Nov 4, 2019. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions markwiki/wiki.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,10 @@ def store(self, content):

try:
with open(self.wiki_path, 'wb') as wiki:
# get rid of any Windows-like ending
wiki.write(content.encode('utf-8').replace('\r\n', '\n'))
# get rid of any Windows-like or MacOS-like line breaks
normalized_content = content.replace('\r\n', '\n')
normalized_content = normalized_content.replace('\r', '\n')
wiki.write(normalized_content.encode('utf-8'))
except IOError:
# Something bad happened while writing so report failure.
return False
Expand Down