mirror of https://github.com/calzoneman/sync.git
Fix a minor matching issue for google docs
This commit is contained in:
parent
4f7ec228d3
commit
9ff23622a0
|
@ -707,7 +707,7 @@ var Getters = {
|
||||||
* Match [[anything]] and ignore whitespace
|
* Match [[anything]] and ignore whitespace
|
||||||
* Fix 2014-08-07: [^] matches \r\n, . doesn't.
|
* Fix 2014-08-07: [^] matches \r\n, . doesn't.
|
||||||
*/
|
*/
|
||||||
var m = res.match(/(\[\s*\[[^\[][^]*?\]\s*\])/);
|
var m = res.match(/\[(\[\s*\[[^\[][^]*?\]\s*\])/);
|
||||||
try {
|
try {
|
||||||
var propertyList = JSON.parse(m[1]);
|
var propertyList = JSON.parse(m[1]);
|
||||||
var data = {};
|
var data = {};
|
||||||
|
@ -751,7 +751,6 @@ var Getters = {
|
||||||
|
|
||||||
callback(null, new Media(id, title, seconds, "gd", { gpdirect: direct }));
|
callback(null, new Media(id, title, seconds, "gd", { gpdirect: direct }));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
|
||||||
return callback("Failed to parse Google Docs output", null);
|
return callback("Failed to parse Google Docs output", null);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
var starHeightSafe = require("safe-regex");
|
||||||
|
var parse = require("ret");
|
||||||
|
|
||||||
|
module.exports = function (re) {
|
||||||
|
if (re.source) {
|
||||||
|
re = re.source;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!starHeightSafe(re)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var node = parse(re);
|
||||||
|
console.log(require('util').inspect(node.stack));
|
||||||
|
console.log(parse.types);
|
||||||
|
return true;
|
||||||
|
};
|
Loading…
Reference in New Issue