From 381f7352b0a2ba2c462a125e286d946c699ccf0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaros=C5=82aw=20Zywert?= Date: Mon, 1 Sep 2025 14:32:50 +0200 Subject: [PATCH 1/2] fix for content metadata key conflict https://github.com/eyeseast/python-frontmatter/issues/96 --- frontmatter/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontmatter/__init__.py b/frontmatter/__init__.py index 12a44c7..6468aac 100644 --- a/frontmatter/__init__.py +++ b/frontmatter/__init__.py @@ -292,7 +292,7 @@ class Post(object): """ def __init__( - self, content: str, handler: BaseHandler | None = None, **metadata: object + self, content: str, handler: BaseHandler | None = None, /, **metadata: object ) -> None: self.content = str(content) self.metadata = metadata From 506899dd18941e4d21afb8f31002756ea12902fe Mon Sep 17 00:00:00 2001 From: Chris Amico Date: Wed, 26 Nov 2025 14:59:31 -0500 Subject: [PATCH 2/2] Add tests for content key problem --- tests/yaml/content-key.md | 5 +++++ tests/yaml/content-key.result.json | 3 +++ 2 files changed, 8 insertions(+) create mode 100644 tests/yaml/content-key.md create mode 100644 tests/yaml/content-key.result.json diff --git a/tests/yaml/content-key.md b/tests/yaml/content-key.md new file mode 100644 index 0000000..692d0e1 --- /dev/null +++ b/tests/yaml/content-key.md @@ -0,0 +1,5 @@ +--- +content: bad key +--- + +Ooops! diff --git a/tests/yaml/content-key.result.json b/tests/yaml/content-key.result.json new file mode 100644 index 0000000..8c84961 --- /dev/null +++ b/tests/yaml/content-key.result.json @@ -0,0 +1,3 @@ +{ + "content": "Ooops!" +} \ No newline at end of file