dworthen/js-yaml-front-matter — pull request #4 by mikl (2013-10-12 14:09:22+00:00)
Title: Make the front matter closing dashes matcher lazy

I was having a bit of trouble parsing several Markdown files with front matter, getting errors like these:

> Fatal error: JS-YAML: expected a single document in the stream, but found more

This was caused by Markdown headers like these:

Chapter IV: A new acquaintance
------------------------------

Since the plus in the `([\w\W]+)` is greedy, it eat the document all the way down to last instance of `---` in our document, which would the header.

The fix is to add a question mark, making the plus lazy, like this `([\w\W]+?)`. That causes only the front matter to be extracted.