Update js/twister_formatpost.js

Co-authored-by: Сёма Мрачный <scary@tasty.sexy>
This commit is contained in:
D4708 2021-04-27 17:40:31 +03:00 committed by GitHub
parent fa093eca15
commit 6c8ead1af5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -720,17 +720,17 @@ function htmlFormatMsg(msg, opt) {
msg = msgAddHtmlEntity(msg, i, i + str.length,
newHtmlEntityLink(twister.tmpl.linkShortened, str, str));
i = msg.i;
} else if (['ipfs://', 'ipns://'].indexOf(msg.str.slice(i, i + 7).toLowerCase()) >= 0 &&
stopCharsRight.indexOf(msg.str[i + 7]) === -1) {
j = getSubStrEnd(msg.str, i + 7, stopCharsRight, false, stopCharsTrailingUrl);
if (j > i + 6) {
str = msg.str.slice(i, j + 1);
msg = msgAddHtmlEntity(msg, i, i + str.length,
newHtmlEntityLink(_htmlFormatMsgLinkTemplateExternal,
str, str)
);
i = msg.i;
}
} else if (['ipfs://', 'ipns://'].indexOf(msg.str.slice(i, i + 7).toLowerCase()) >= 0
&& stopCharsRight.indexOf(msg.str[i + 7]) === -1) {
j = getSubStrEnd(msg.str, i + 7, stopCharsRight, false, stopCharsTrailingUrl);
if (j > i + 6) {
str = msg.str.slice(i, j + 1);
msg = msgAddHtmlEntity(msg, i, i + str.length,
newHtmlEntityLink(_htmlFormatMsgLinkTemplateExternal,
str, str)
);
i = msg.i;
}
}
}