mirror of https://github.com/keeweb/keeweb.git
fix #582: auto-type custom fields with spaces
This commit is contained in:
parent
3978f3c11d
commit
7ef2dba018
|
@ -6,7 +6,7 @@ const AutoTypeParser = function(sequence) {
|
|||
this.states = [];
|
||||
};
|
||||
|
||||
AutoTypeParser.opSepRegex = /[\s:=]+/;
|
||||
AutoTypeParser.opRegex = /^(.*?)(?:([\s:=])[\s:=]*(.*))?$/;
|
||||
|
||||
AutoTypeParser.prototype.parse = function() {
|
||||
const len = this.sequence.length;
|
||||
|
@ -75,15 +75,8 @@ AutoTypeParser.prototype.readOp = function() {
|
|||
this.addChar(contents);
|
||||
return;
|
||||
}
|
||||
const parts = contents.split(AutoTypeParser.opSepRegex, 2);
|
||||
if (parts.length > 1 && parts[0].length && parts[1].length) {
|
||||
const op = parts[0];
|
||||
const sep = contents.substr(op.length, 1);
|
||||
const arg = parts[1];
|
||||
this.addOp(op, sep, arg);
|
||||
} else {
|
||||
this.addOp(contents);
|
||||
}
|
||||
const [, op, sep, arg] = contents.match(AutoTypeParser.opRegex);
|
||||
this.addOp(op, sep, arg);
|
||||
};
|
||||
|
||||
AutoTypeParser.prototype.readModifier = function(modifier) {
|
||||
|
|
Loading…
Reference in New Issue