parsing blog successfully and requesting youtube

This commit is contained in:
2026-11-04 13:46:19 +00:00
parent 0e65b8004e
commit 1ce397b734
132 changed files with 18999 additions and 52 deletions

23
node_modules/fast-xml-builder/src/util.js generated vendored Normal file
View File

@@ -0,0 +1,23 @@
// String(val)/val.toString() drop the sign of -0 (e.g. String(-0) === '0'), silently
// corrupting a round-tripped negative-zero value. XML has no separate int/float syntax,
// so this is the single place every raw value gets turned into text.
export function valToStr(val) {
return typeof val === 'number' && Object.is(val, -0) ? '-0' : String(val)
}
export function safeComment(val) {
return valToStr(val)
.replace(/--/g, '- -') // -- is illegal anywhere in comment content
.replace(/--/g, '- -') // handle the scenario when 2 consiucative dashes appears
.replace(/-$/, '- '); // trailing - would form -- with the closing -->
}
export function safeCdata(val) {
return valToStr(val).replace(/\]\]>/g, ']]]]><![CDATA[>')
}
export function escapeAttribute(val) {
return valToStr(val).replace(/"/g, '&quot;').replace(/'/g, '&apos;')
}