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
Merged

Conversation

@Kwpolska
Copy link
Member

@Kwpolska Kwpolska commented Jun 11, 2017

  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 Jun 11, 2017
@felixfontein
Copy link
Contributor

@felixfontein felixfontein commented Jun 11, 2017

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

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

@felixfontein felixfontein Jun 11, 2017

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

Copy link
Member Author

@Kwpolska Kwpolska Jun 12, 2017

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

gwax
gwax approved these changes Jun 12, 2017
Copy link
Contributor

@gwax gwax left a comment

🚢

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

Successfully merging this pull request may close these issues.

None yet

3 participants