Skip to content

Commit

Permalink
Merge branch 'main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidSouther authored Nov 27, 2024
2 parents b56aa30 + 7f17f6e commit 2ec44c1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .tools/readmes/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ def render(self) -> RenderStatus:
customs=customs,
unsupported=unsupported,
)
self.readme_text += "\n" # Jinja is the worst and strips trailing new lines
[text, errors] = expand_all_entities(self.readme_text, self.scanner.doc_gen.entities)
if errors:
raise errors
Expand Down Expand Up @@ -332,7 +333,11 @@ def write(self):
def read_current(self):
try:
with self.readme_filename.open("r", encoding="utf-8") as f:
return f.read()
current = f.read()
if current[-1] != "\n":
# Ensure there's always an ending newline
current += "\n"
return current
except FileNotFoundError:
return ""

Expand Down

0 comments on commit 2ec44c1

Please sign in to comment.