Skip to content

Using 'content' as a metadata key breaks frontmatter #96

@harleypig

Description

@harleypig

If I have a file with content as a key in the frontmatter, frontmatter dies a horrible death.

Example markdown file (test.md):

---
content: bad key
---
Ooops!

Example python file (badkey.py):

import frontmatter
post = frontmatter.load('test.md')

When running python badkey.py you get:

$ python badkey.py 
Traceback (most recent call last):
  File "/home/harleypig/work/pfm/badkey.py", line 3, in <module>
    post = frontmatter.load('test.md')
  File "/home/harleypig/.local/lib/python3.10/site-packages/frontmatter/__init__.py", line 150, in load
    return loads(text, encoding, handler, **defaults)
  File "/home/harleypig/.local/lib/python3.10/site-packages/frontmatter/__init__.py", line 166, in loads
    return Post(content, handler, **metadata)
TypeError: Post.__init__() got multiple values for argument 'content'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions