]> git.mxchange.org Git - friendica.git/commitdiff
Prevents linkPreview to match on URLs lead by an equal sign
authorHypolite Petovan <hypolite@mrpetovan.com>
Sat, 17 Aug 2019 03:04:46 +0000 (23:04 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sat, 17 Aug 2019 03:04:46 +0000 (23:04 -0400)
- Prevent automatic link preview matching on inserted image BBCode

view/js/linkPreview.js

index be5cdd0a940bf4cbcfa4cad6aaf2b7199bf7babc..7644af7fee4f37b41ee25eada88458284020ade5 100644 (file)
@@ -52,7 +52,7 @@
                        <div class="clear"></div>\
                        <hr class="previewseparator">';
                var text;
-               var urlRegex = /(https?\:\/\/|\s)[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})(\/+[a-z0-9_.\:\;-]*)*(\?[\&\%\|\+a-z0-9_=,\.\:\;-]*)?([\&\%\|\+&a-z0-9_=,\:\;\.-]*)([\!\#\/\&\%\|\+a-z0-9_=,\:\;\.-]*)}*/i;
+               var urlRegex = /(?<!=)(https?\:\/\/|\s)[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})(\/+[a-z0-9_.\:\;-]*)*(\?[\&\%\|\+a-z0-9_=,\.\:\;-]*)?([\&\%\|\+&a-z0-9_=,\:\;\.-]*)([\!\#\/\&\%\|\+a-z0-9_=,\:\;\.-]*)}*/i;
                var binurl;
                var block = false;
                var blockTitle = false;