1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-10-25 20:57:38 +00:00

Allow digits in field names

This commit is contained in:
Jermolene
2014-04-28 15:54:32 +01:00
parent 84cd296c58
commit 0ac4c2b554
3 changed files with 15 additions and 4 deletions

View File

@@ -413,6 +413,18 @@ exports.parseTextReference = function(textRef) {
}
};
/*
Checks whether a string is a valid fieldname
*/
exports.isValidFieldName = function(name) {
if(!name || typeof name !== "string") {
return false;
}
name = name.toLowerCase().trim();
var fieldValidatorRegEx = /^[a-z0-9\-\._]+$/mg;
return fieldValidatorRegEx.test(name);
};
/*
Extract the version number from the meta tag or from the boot file
*/