Skip to content

Newlines at end of post #87

@hhoeflin

Description

@hhoeflin

Hi,

here an issue I tripped over (or minor problem of faithful round-tripping). I wanted to read a post, manipulate the frontmatter and write it back out. Afterwards, I programmatically append things to the post.

when I do

page_post = frontmatter.load(post_path)                           
# change the metadata somehow  
frontmatter.dump(page_post, post_path)                            

Now, the newlines at the end of the post have disappeared. In my case, this was a problem as I relied on them for syntactically correct appending.

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