From 7070aed68a52abc0771d9b625d2628764a6062fc Mon Sep 17 00:00:00 2001 From: Uriel Gomez Date: Sun, 14 Jan 2024 09:07:45 -0600 Subject: [PATCH] * xover.Source.fetch - bug fixed for null values in the json evaluation * section_renderer_handler - added stylesheet * condition in order to use document's stylesheets --- xo.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xo.js b/xo.js index 8dd0f1c..a4decce 100644 --- a/xo.js +++ b/xo.js @@ -2475,7 +2475,9 @@ xover.Source = function (tag) { while (!response && sources.length) { let evaluate_json = (value) => { let result; - if ([].constructor === value.constructor) { + if (value == null) { + result = value + } else if ([].constructor === value.constructor) { result = []; for (let item of value) { result.push(evaluate_json(item)) @@ -11173,7 +11175,7 @@ xover.modernize = async function (targetWindow) { await source_document.ready } } - stylesheets = stylesheet && [stylesheet] || source_document && source_document.getStylesheets() || []; + stylesheets = stylesheet && stylesheet !== '*' && [stylesheet] || stylesheet == '*' && source_document && source_document.getStylesheets() || []; if (stylesheets.length) { stylesheets = stylesheets.map(stylesheet => typeof (stylesheet) === 'string' && { type: 'text/xsl', href: stylesheet, target: self, store: (target_store || {}).tag } || stylesheet instanceof ProcessingInstruction && xover.json.fromAttributes(stylesheet.data) || null).filter(stylesheet => stylesheet); for (let stylesheet of stylesheets) {