support string span

This commit is contained in:
j 2017-01-25 22:38:43 +01:00
parent 71c163f9fb
commit 74f3f58942

View file

@ -619,6 +619,7 @@ Ox.URL = function(options) {
canBeDuration = types.indexOf('duration') > -1,
canBeLocation = types.indexOf('location') > -1,
canBeNumber = types.indexOf('number') > -1,
canBeString = types.indexOf('string') > -1,
length = str.split(',').length;
// !/^\d{7}$/.test(str) avoids matching imdb ids
return canBeDate && /\d-/.test(str) ? 'date'
@ -629,6 +630,7 @@ Ox.URL = function(options) {
: canBeDate && !/\./.test(str) && !/^\d{7}$/.test(str) ? 'date'
: canBeLocation && length == 2 ? 'location'
: canBeNumber && /^\d+$/.test(str) ? 'number'
: canBeString && str.length ? 'string'
: '';
}