Skip to content

Commit

Permalink
Merge pull request #372 from Swiftb0y/fix/gh371-handle-CRLF-update-bl…
Browse files Browse the repository at this point in the history
…ogpost

fix: replace `\r\n` in blogposts with `\n` after merge
  • Loading branch information
daschuer authored Nov 27, 2024
2 parents 3cf9eb9 + a8e8062 commit cde9814
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tools/update_news_date.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@ def main(argv=None):
continue

with open(
filepath, mode="r", encoding="utf-8", newline="\n"
filepath,
mode="r",
encoding="utf-8",
newline=None, # translate any \r\n to \n during read
) as fp:
header, sep, body = fp.read().partition("\n\n")
if not RE_POST_STATUS.findall(header):
Expand Down

0 comments on commit cde9814

Please sign in to comment.