I am using frontmatter in a python script to convert MD files to XML and I found this issue where I have an MD file having a field called 'content' for which, creating a Post instance doesn't work, returning the following exception:
File "C:\work\projects\xxx\venv\Lib\site-packages\frontmatter\__init__.py", line 168, in loads
return Post(content, handler, **metadata)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Post.__init__() got multiple values for argument 'content'
An easy fix for this would be to add a condition to replace the name of the key in metadata, if a content key is already existing:
if 'content' in metadata.keys():
metadata['metadata_content'] = metadata.pop('content')
In my case, I added it in the parse function, line 85.
Can this be implemented in the following release of the package?
Hi,
I am using frontmatter in a python script to convert MD files to XML and I found this issue where I have an MD file having a field called 'content' for which, creating a Post instance doesn't work, returning the following exception:
An easy fix for this would be to add a condition to replace the name of the key in metadata, if a content key is already existing:
In my case, I added it in the parse function, line 85.
Can this be implemented in the following release of the package?