Skip to content

Commit 684d54c

Browse files
committed
Rebuild with patch
1 parent 4e9efa9 commit 684d54c

File tree

3 files changed

+70
-2
lines changed

3 files changed

+70
-2
lines changed

build/CommentCoreLibrary.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1041,6 +1041,20 @@ function BilibiliParser(xmlDoc, text, warn){
10411041
return string.replace(/\t/,"\\t");
10421042
}
10431043

1044+
function formatmode7(text) {
1045+
if (text.charAt(0) == '[') switch (text.charAt(text.length - 1)) {
1046+
case ']':
1047+
return text;
1048+
case '"':
1049+
return text + ']';
1050+
case ',':
1051+
return text.substring(0, text.length - 1) + '"]';
1052+
default:
1053+
return formatmode7(text.substring(0, text.length - 1));
1054+
};
1055+
if (text.charAt(0) !== '[') return text;
1056+
};
1057+
10441058
if(xmlDoc !== null){
10451059
var elems = xmlDoc.getElementsByTagName('d');
10461060
}else{
@@ -1088,7 +1102,7 @@ function BilibiliParser(xmlDoc, text, warn){
10881102
}else{
10891103
if(obj.mode == 7){
10901104
try{
1091-
adv = JSON.parse(format(text));
1105+
adv = JSON.parse(format(formatmode7(text)));
10921106
obj.shadow = true;
10931107
obj.x = parseFloat(adv[0]);
10941108
obj.y = parseFloat(adv[1]);

0 commit comments

Comments
 (0)