Skip to content
Merged
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
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