eyeseast / python-frontmatter

Parse and manage posts with YAML (or other) frontmatter
http://python-frontmatter.rtfd.io
MIT License
334 stars 42 forks source link

Consider using regex groups rather than FM_BOUNDARY #50

Closed NGenetzky closed 6 years ago

NGenetzky commented 6 years ago

Regex is a powerful tool and it could be used to more precisely split the data. The performance impact appears to be negligible.

I believe this would eliminate the need for START_DELIMITER and END_DELIMITER; however, these are exposed all the way up to the public API (for some reason?) and so that may be an issue.

If someone wanted to get fancy I am sure all three of the above regex could be generated from a function that accepts start and end delimiters.

eyeseast commented 6 years ago

I bounced back and forth on this in earlier versions and found that for my own sanity, using split() just made everything easier.

The reason for exposing START_DELIMITER and END_DELIMITER is so people can change the output.

I'm going to close this, but I appreciate the input.