From fdff12e48a7330b12a5f33b6c4421f41a40d745e Mon Sep 17 00:00:00 2001 From: PranavAwasthi Date: Tue, 28 Nov 2023 15:33:20 +0530 Subject: [PATCH] fixed attribute issue in shortcode --- js/qsm-quiz.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/js/qsm-quiz.js b/js/qsm-quiz.js index 28becd64c..fecfcce84 100644 --- a/js/qsm-quiz.js +++ b/js/qsm-quiz.js @@ -1507,16 +1507,17 @@ jQuery(function () { let height = ''; videoAttributePatterns.forEach(pattern => { - if (!src) { - const attrMatch = match.match(pattern); - if (attrMatch) { + const attrMatch = match.match(pattern); + if (attrMatch) { + if (pattern.toString().includes('width')) { + width = attrMatch[1] || ''; + } else if (pattern.toString().includes('height')) { + height = attrMatch[1] || ''; + } else { src = attrMatch[1] || ''; - if (pattern.toString().includes('width')) width = attrMatch[1] || ''; - if (pattern.toString().includes('height')) height = attrMatch[1] || ''; } } }); - const videoTag = ``; return `
${videoTag}
`; });