From 70e4220c935be0903f6ff0bb0c8aca060c59c476 Mon Sep 17 00:00:00 2001 From: Christopher Pickering Date: Thu, 19 Jan 2023 11:53:56 -0600 Subject: [PATCH] naturalized line endings when beginning formatting --- src/djlint/reformat.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/djlint/reformat.py b/src/djlint/reformat.py index fb5afd9..9288f09 100644 --- a/src/djlint/reformat.py +++ b/src/djlint/reformat.py @@ -19,7 +19,8 @@ def reformat_file(config: Config, this_file: Path) -> dict: """Reformat html file.""" rawcode = this_file.read_bytes().decode("utf8") - compressed = compress_html(rawcode, config) + # naturalize the line breaks + compressed = compress_html(("\n").join(rawcode.splitlines()), config) expanded = expand_html(compressed, config)