front-matter
Advanced tools
Comparing version 0.1.4 to 0.1.5
@@ -22,3 +22,3 @@ var parser = require('yaml-js') | ||
+ '$([\\s\\S]*?)' | ||
+ seperator+'$' + (process.platform === 'win32' ? '\\r?' : '') + '\\n)' | ||
+ seperator+'$' + (process.platform === 'win32' ? '\\r?' : '') + '(?:\\n)?)' | ||
, regex = new RegExp(pattern, 'm') | ||
@@ -25,0 +25,0 @@ , match = regex.exec(string) |
@@ -11,3 +11,3 @@ { | ||
"license": "MIT", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"homepage": "https://github.com/jxson/front-matter", | ||
@@ -32,3 +32,10 @@ "bugs": "https://github.com/jxson/front-matter/issues", | ||
"mocha": "1.7.4" | ||
} | ||
}, | ||
"contributors": [ | ||
"Jason Campbell <jason@js.la> (http://twitter.com/jxson)", | ||
"Jordan Santell <jsantell@gmail.com> (https://github.com/jsantell)", | ||
"Kai Davenport <kaiyadavenport@gmail.com> (https://github.com/binocarlos)", | ||
"Jean-Philippe Monette <contact@jpmonette.net> (https://github.com/jpmonette)", | ||
"Marc-André Arseneault <marc-andre@arsnl.ca> (https://github.com/arsnl)" | ||
] | ||
} |
# front-matter [![build status](https://secure.travis-ci.org/jxson/front-matter.png)](http://travis-ci.org/jxson/front-matter) | ||
# front-matter | ||
Extract [YAML][yaml] front matter from strings. | ||
[![NPM](https://nodei.co/npm/front-matter.png)](https://nodei.co/npm/front-matter/) | ||
## Extract [YAML][yaml] front matter from strings. | ||
[![build status](https://secure.travis-ci.org/jxson/front-matter.png)](http://travis-ci.org/jxson/front-matter) | ||
[![Dependency Status](https://david-dm.org/jxson/front-matter.png)](https://david-dm.org/jxson/front-matter) | ||
This modules does not do any IO (file loading or reading), only extracting yaml front matter from strings. | ||
@@ -12,2 +17,8 @@ | ||
# Install | ||
With [npm][npm] do: | ||
npm install front-matter | ||
# Example | ||
@@ -56,12 +67,27 @@ | ||
## Install | ||
# Contributing | ||
With [npm][npm] do: | ||
front-matter is an OPEN Source Project so please help out by [reporting bugs](http://github.com/jxson/front-matter/issues) or [forking and opening pull](https://github.com/jxson/front-matter) requests when possible. | ||
npm install front-matter | ||
### Contirbutors | ||
# License | ||
This module is awesome beacuse of all the folks who helped out: | ||
MIT | ||
* **Jason Campbell**: [github](https://github.com/jxson) - [twitter](https://twitter.com/jxson) | ||
* **Jordan Santell**: [github](https://github.com/jsantell) - [twitter](https://twitter.com/jsantell) | ||
* **Kai Davenport**: [github](https://github.com/binocarlos) | ||
* **Jean-Philippe Monette**: [github](https://github.com/jpmonette) - [twitter](https://twitter.com/jpmonette) | ||
* **Marc-André Arseneault**: [github](https://github.com/arsnl) - [twitter](https://twitter.com/im_arsnl) | ||
# LICENSE (MIT) | ||
Copyright (c) Jason Campbell ("Author") | ||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
[yaml]: http://en.wikipedia.org/wiki/YAML | ||
@@ -68,0 +94,0 @@ [haiku]: http://haiku.io |
@@ -61,3 +61,21 @@ | ||
it('parses wrapped text in yaml prperly', function(done){ | ||
it('works on strings missing body', function(done){ | ||
read('missing-body.md', function(err, data){ | ||
if (err) return done(err) | ||
var content = fm(data) | ||
assert.validExtraction(content) | ||
assert.hasBody(content, '') | ||
assert.propertyVal(content.attributes | ||
, 'title' | ||
, 'Three dashes marks the spot') | ||
assert.property(content.attributes, 'tags') | ||
assert.lengthOf(content.attributes.tags, 3) | ||
done() | ||
}) | ||
}) | ||
it('parses wrapped text in yaml properly', function(done){ | ||
read('wrapped-text.md', function(err, data){ | ||
@@ -64,0 +82,0 @@ if (err) return done(err) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11634
12
126
95