Comparing version 0.2.7 to 0.2.8
26
cbml.js
@@ -10,4 +10,4 @@ (function (exportName) { | ||
* zswang (http://weibo.com/zswang) | ||
* @version 0.2.7 | ||
* @date 2016-01-06 | ||
* @version 0.2.8 | ||
* @date 2016-06-28 | ||
*/ | ||
@@ -138,2 +138,3 @@ /*<function name="decodeHTML">*/ | ||
var attrs = {}; | ||
var attrStyles = {}; // 『'』、『"』、undefined | ||
var offset = match[0].length; | ||
@@ -238,2 +239,3 @@ var language; | ||
attrValue = attrValue.slice(1, -1); | ||
attrStyles[attrName] = attrValue[0]; | ||
break; | ||
@@ -275,2 +277,22 @@ } | ||
} | ||
if (language === 'c') { // jsx | ||
var isJsx; | ||
Object.keys(attrs).some(function (key) { | ||
if (!attrStyles[key] && /^\s*\{/.test(attrs[key])) { | ||
isJsx = true; | ||
return true; | ||
} | ||
}); | ||
if (isJsx) { | ||
match = S.text.substring(S.pos + offset).match(/^[^]*?>\*\//); | ||
if (match) { | ||
offset += match[0].length; | ||
pushToken('text', S.pos, S.pos + offset); // 记录 text | ||
} else { | ||
offset = S.text.length; | ||
pushToken('text', S.pos, offset); // 记录 text | ||
} | ||
continue; | ||
} | ||
} | ||
buffer = code.slice(0, S.pos + offset).split('\n'); | ||
@@ -277,0 +299,0 @@ line = buffer.length; |
@@ -0,0 +0,0 @@ #!/usr/bin/env node |
{ | ||
"name": "cbml", | ||
"version": "0.2.7", | ||
"version": "0.2.8", | ||
"description": "CBML Parser", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/cbml/cbmljs", |
@@ -0,0 +0,0 @@ # [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][coverage-image]][coverage-url] |
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
18673
542