From d9695f85401f2bf4223a2653c1f19edfc6dbb89e Mon Sep 17 00:00:00 2001 From: j Date: Tue, 13 Mar 2018 18:09:01 +0530 Subject: [PATCH] also parse if only strings are allowed --- source/UI/js/Core/URL.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/UI/js/Core/URL.js b/source/UI/js/Core/URL.js index b1250009..15c96072 100644 --- a/source/UI/js/Core/URL.js +++ b/source/UI/js/Core/URL.js @@ -607,12 +607,18 @@ Ox.URL = function(options) { return ret; } + function hasOnlyStringType(spanTypes) { + var types = Ox.unique(Ox.values(spanTypes)); + return types.length == 1 && types[0] == 'string'; + } + function isNumericalSpan(str) { return str.split(',').every(function(str) { return /^[0-9-\.:]+$/.test(str); }); } + function getSpanType(str, types) { Ox.Log('Core', 'getSpanType', str, types) var canBeDate = types.indexOf('date') > -1, @@ -922,7 +928,7 @@ Ox.URL = function(options) { spanTypes = self.options.spanType[state.type][ !state.item ? 'list' : 'item' ]; - if (isNumericalSpan(parts[0])) { + if (isNumericalSpan(parts[0]) || hasOnlyStringType(spanTypes)) { // test for numerical span // if no view is given then parse the span anyway, // but make sure the span type could match a view