From 6c8ead1af5b9526c3a33cbcd913158808a35632c Mon Sep 17 00:00:00 2001 From: D4708 <76843085+D4708@users.noreply.github.com> Date: Tue, 27 Apr 2021 17:40:31 +0300 Subject: [PATCH] Update js/twister_formatpost.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Сёма Мрачный --- js/twister_formatpost.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/js/twister_formatpost.js b/js/twister_formatpost.js index 21dc5d6..24d25dd 100644 --- a/js/twister_formatpost.js +++ b/js/twister_formatpost.js @@ -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; + } } }