Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix two grave and one interop bug in TOML/YAML meta handling #2832

Merged
merged 2 commits into from Jun 12, 2017

Conversation

Kwpolska
Copy link
Member

  1. toml.load wants a file handle, toml.loads wants a string
  2. + has special meaning in regular expressions
  3. Require one linebreak after TOML/YAML (as Jekyll does)

Releasing v7.8.8 after this merges.

1. toml.load wants a file handle, toml.loads wants a string
2. `+` has special meaning in regular expressions
3. Require one linebreak after TOML/YAML (as Jekyll does)
@Kwpolska Kwpolska requested a review from ralsina June 11, 2017 15:58
@felixfontein
Copy link
Contributor

For anyone else interested, the toml library documentation: https://github.com/uiri/toml/blob/master/README.rst#api-reference

Copy link
Contributor

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

"""
if data.startswith('---'): # YAML metadata
split_result = re.split('(\n---\n\n|\r\n---\r\n\r\n)', data.lstrip(), maxsplit=1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we don't want to expect a double newline after the end of metadata?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s not necessary if we have a --- / +++ separator already. This also mimics Jekyll behavior.

Copy link
Contributor

@gwax gwax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

@Kwpolska Kwpolska merged commit 8f8a215 into master Jun 12, 2017
@Kwpolska Kwpolska deleted the fix-toml-meta branch June 12, 2017 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants