diff --git a/src/mkslides_reveal/config.py b/src/mkslides_reveal/config.py index 54bab68..ce2609e 100644 --- a/src/mkslides_reveal/config.py +++ b/src/mkslides_reveal/config.py @@ -67,7 +67,7 @@ def get_plugins(self) -> list | None: return self.__get("plugins") def merge_config_from_file(self, config_path: Path) -> None: - with config_path.open() as f: + with config_path.open(encoding="utf-8-sig") as f: new_config = yaml.safe_load(f) self.__config = self.__recursive_merge(self.__config, new_config) diff --git a/src/mkslides_reveal/constants.py b/src/mkslides_reveal/constants.py index 35edb14..d5c6bc4 100644 --- a/src/mkslides_reveal/constants.py +++ b/src/mkslides_reveal/constants.py @@ -71,9 +71,11 @@ VERSION = metadata.version("mkslides_reveal") REVEALJS_VERSION = None -with REVEALJS_RESOURCE.joinpath("package.json").open() as f: +with REVEALJS_RESOURCE.joinpath("package.json").open(encoding="utf-8-sig") as f: REVEALJS_VERSION = json.load(f)["version"] HIGHLIGHTJS_THEMES_VERSION = None -with HIGHLIGHTJS_RESOURCE.joinpath("build", "package.json").open() as f: +with HIGHLIGHTJS_RESOURCE.joinpath("build", "package.json").open( + encoding="utf-8-sig" +) as f: HIGHLIGHTJS_THEMES_VERSION = json.load(f)["version"] diff --git a/src/mkslides_reveal/markupgenerator.py b/src/mkslides_reveal/markupgenerator.py index e57f56a..2f15709 100644 --- a/src/mkslides_reveal/markupgenerator.py +++ b/src/mkslides_reveal/markupgenerator.py @@ -103,7 +103,7 @@ def __process_markdown_file( # Retrieve the frontmatter metadata and the markdown content - content = md_file.read_text() + content = md_file.read_text(encoding="utf-8-sig") metadata, markdown = frontmatter.parse(content) # Get the relative path of reveal.js