Correct bug with encoding when generating Markdown documentation; linked with issue #1880 (#1881)

This commit is contained in:
Alberto Villa 2021-12-14 10:50:25 +01:00 committed by GitHub
parent 57a04631df
commit 2396f0cd3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,7 +26,7 @@ e = MarkdownExporter(exclude_output=True)
for i, nb in enumerate(notebooks):
body, resources = e.from_filename(dir / nb)
print(f"Processing {dir}/{nb}")
with open(str(i + 1) + ".md", "w") as f:
with open(str(i + 1) + ".md", "w", encoding='utf-8') as f:
f.write(headers[i + 1] + "\n\n")
f.write(body)