Permalink
Browse files

Force initial three hyphens to be the first three characters of the f…

…ile.

This make the regex more robust, and prevents accidental parsing of non YAML triple hyphen pairs.
  • Loading branch information...
1 parent c063a71 commit 06da1a382e39ab670c1b0e3297250e94a72b0b64 @benbalter benbalter committed Dec 8, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 _includes/model.js
View
@@ -353,7 +353,7 @@ function loadPost(user, repo, branch, path, file, cb) {
};
var res = { raw_metadata: "", published: false };
- res.content = content.replace(/(---\n)((.|\n)*?)\n---\n?/, function(match, dashes, frontmatter) {
+ res.content = content.replace(/^(---\n)((.|\n)*?)\n---\n?/, function(match, dashes, frontmatter) {
res.raw_metadata = frontmatter;
res.published = published(frontmatter);
return "";

0 comments on commit 06da1a3

Please sign in to comment.