single-file-core 1.5.10 → 1.5.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -94,7 +94,7 @@ function serializeTextNode(textNode) {
|
|
|
94
94
|
parentTagName = getTagName(parentNode);
|
|
95
95
|
}
|
|
96
96
|
if (!parentTagName || TEXT_NODE_TAGS.includes(parentTagName)) {
|
|
97
|
-
if (parentTagName == "SCRIPT" || parentTagName == "STYLE") {
|
|
97
|
+
if ((parentTagName == "SCRIPT" && (!parentNode.type || parentNode.type == "text/javascript")) || parentTagName == "STYLE") {
|
|
98
98
|
return textNode.textContent.replace(/<\//gi, "<\\/").replace(/\/>/gi, "\\/>");
|
|
99
99
|
}
|
|
100
100
|
return textNode.textContent;
|
|
@@ -180,5 +180,5 @@ function startsWithSpaceChar(textContent) {
|
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
function getTagName(element) {
|
|
183
|
-
return
|
|
183
|
+
return element.tagName && element.tagName.toUpperCase();
|
|
184
184
|
}
|
|
@@ -17021,7 +17021,7 @@ async function evalTemplate(template = "", options, content, doc, dontReplaceSla
|
|
|
17021
17021
|
"date-locale": locales => new Date().toLocaleDateString(locales),
|
|
17022
17022
|
"time-locale": locales => new Date().toLocaleTimeString(locales),
|
|
17023
17023
|
"datetime-locale": locales => new Date().toLocaleString(locales),
|
|
17024
|
-
"datetime-custom": (locale, year, month, day, weekday, hour, minute, second, hour12, timeZone, fractionalSecondDigits, timeZoneName, era, localeMatcher) => {
|
|
17024
|
+
"datetime-custom": (locale, year, month, day, weekday, hour, minute, second, hour12, timeZone, fractionalSecondDigits, timeZoneName, dayPeriod, era, localeMatcher) => {
|
|
17025
17025
|
const date = new Date();
|
|
17026
17026
|
const options = {};
|
|
17027
17027
|
setOption(options, "year", year);
|
|
@@ -17032,9 +17032,11 @@ async function evalTemplate(template = "", options, content, doc, dontReplaceSla
|
|
|
17032
17032
|
setOption(options, "minute", minute);
|
|
17033
17033
|
setOption(options, "second", second);
|
|
17034
17034
|
setOption(options, "hour12", hour12);
|
|
17035
|
+
options.hour12 = hour12 == "true";
|
|
17035
17036
|
setOption(options, "timeZone", timeZone);
|
|
17036
17037
|
setOption(options, "fractionalSecondDigits", fractionalSecondDigits);
|
|
17037
17038
|
setOption(options, "timeZoneName", timeZoneName);
|
|
17039
|
+
setOption(options, "dayPeriod", dayPeriod);
|
|
17038
17040
|
setOption(options, "era", era);
|
|
17039
17041
|
setOption(options, "localeMatcher", localeMatcher);
|
|
17040
17042
|
return new Intl.DateTimeFormat(locale, options).format(date);
|