mirror of
https://github.com/SilenceLurker/ST-Amily2-Chat-Optimisation.git
synced 2026-06-06 15:55:50 +00:00
Update tagProcessor.js
This commit is contained in:
@@ -1,21 +1 @@
|
||||
function extractContentByTag(xmlString, tagName) {
|
||||
const regex = new RegExp(`<${tagName}[^>]*>([\\s\\S]*?)<\\/${tagName}>`);
|
||||
const match = xmlString.match(regex);
|
||||
return match ? match[1] : null;
|
||||
}
|
||||
|
||||
function extractFullTagBlock(xmlString, tagName) {
|
||||
const regex = new RegExp(`(<${tagName}[^>]*>[\\s\\S]*?<\\/${tagName}>)`);
|
||||
const match = xmlString.match(regex);
|
||||
return match ? match[0] : null;
|
||||
}
|
||||
|
||||
function replaceContentByTag(xmlString, tagName, newContent) {
|
||||
const regex = new RegExp(`(<${tagName}[^>]*>)[\\s\\S]*?(<\\/${tagName}>)`);
|
||||
if (regex.test(xmlString)) {
|
||||
return xmlString.replace(regex, `$1${newContent}$2`);
|
||||
}
|
||||
return xmlString;
|
||||
}
|
||||
|
||||
export { extractContentByTag, replaceContentByTag, extractFullTagBlock };
|
||||
function _0x1dcd(){const _0x257c0d=['10568IKrFzQ','10raWmYe','40oVWpEs','3837510XPwlyb','19698294yxzjsl','928210ehDZlJ','3195lOUbIC','test','[^>]*>([\x5cs\x5cS]*?)<\x5c/','1803284cffxyt','replace','19297cMRACv','4829070apNikW','[^>]*>[\x5cs\x5cS]*?<\x5c/','match','18nDvPyz','[^>]*>)[\x5cs\x5cS]*?(<\x5c/'];_0x1dcd=function(){return _0x257c0d;};return _0x1dcd();}(function(_0x1a12c4,_0x29cd05){const _0x74812=_0x599e,_0x5d660f=_0x1a12c4();while(!![]){try{const _0x4218fd=-parseInt(_0x74812(0x18d))/0x1*(-parseInt(_0x74812(0x194))/0x2)+parseInt(_0x74812(0x18e))/0x3+parseInt(_0x74812(0x195))/0x4*(-parseInt(_0x74812(0x198))/0x5)+-parseInt(_0x74812(0x191))/0x6*(parseInt(_0x74812(0x19c))/0x7)+-parseInt(_0x74812(0x193))/0x8*(-parseInt(_0x74812(0x199))/0x9)+-parseInt(_0x74812(0x196))/0xa+parseInt(_0x74812(0x197))/0xb;if(_0x4218fd===_0x29cd05)break;else _0x5d660f['push'](_0x5d660f['shift']());}catch(_0x52e0cd){_0x5d660f['push'](_0x5d660f['shift']());}}}(_0x1dcd,0xe8a2d));function extractContentByTag(_0x2dff05,_0x2eb32d){const _0x53ccfc=_0x599e,_0x110006=new RegExp('<'+_0x2eb32d+_0x53ccfc(0x19b)+_0x2eb32d+'>'),_0x3d6c4b=_0x2dff05[_0x53ccfc(0x190)](_0x110006);return _0x3d6c4b?_0x3d6c4b[0x1]:null;}function _0x599e(_0x273595,_0x820835){const _0x1dcdc3=_0x1dcd();return _0x599e=function(_0x599ecc,_0x7222df){_0x599ecc=_0x599ecc-0x18d;let _0x53a3c8=_0x1dcdc3[_0x599ecc];return _0x53a3c8;},_0x599e(_0x273595,_0x820835);}function extractFullTagBlock(_0x1e5928,_0x3bf36a){const _0x40de1f=_0x599e,_0x6ed70d=new RegExp('(<'+_0x3bf36a+_0x40de1f(0x18f)+_0x3bf36a+'>)'),_0x3c15da=_0x1e5928[_0x40de1f(0x190)](_0x6ed70d);return _0x3c15da?_0x3c15da[0x0]:null;}function replaceContentByTag(_0x50f940,_0x3a36a5,_0x5dc1f6){const _0x373930=_0x599e,_0x4497b0=new RegExp('(<'+_0x3a36a5+_0x373930(0x192)+_0x3a36a5+'>)');if(_0x4497b0[_0x373930(0x19a)](_0x50f940))return _0x50f940[_0x373930(0x19d)](_0x4497b0,'$1'+_0x5dc1f6+'$2');return _0x50f940;}export{extractContentByTag,replaceContentByTag,extractFullTagBlock};
|
||||
|
||||
Reference in New Issue
Block a user