Permalink
Browse files

Add JSML support

Todo: Change README
  • Loading branch information...
1 parent 72bfffc commit 54084372e990ea9b2ac05cdb15350fd4ee310346 @pvorb committed Aug 9, 2012
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -12,13 +12,15 @@
"parser",
"properties",
"json",
- "yaml"
+ "yaml",
+ "jsml"
],
"bugs": {
"url": "http://github.com/pvorb/node-props/issues"
},
"dependencies": {
- "js-yaml": ">=0.3.5 <1.1.0"
+ "js-yaml": ">=0.3.5 <1.1.0",
+ "jsml": "<0.1.0"
},
"devDependencies": {},
"engines": {
View
@@ -1,4 +1,5 @@
-var yaml = require('js-yaml');
+var JSML = require('jsml');
+var YAML = require('js-yaml');
module.exports = function(str, div) {
div = div || /\n\n\n|\r\n\r\n\r\n/;
@@ -20,9 +21,12 @@ module.exports = function(str, div) {
// JSON
if (split[0].charAt(0) == '{')
result = JSON.parse(split[0]);
+ // JSML
+ else if (split[0].charAt(0) == '"')
+ result = JSML.parse(split[0]);
// YAML
else
- result = yaml.load(split[0]);
+ result = YAML.load(split[0]);
} catch (e) {
return { __content: str };
}

0 comments on commit 5408437

Please sign in to comment.