瀏覽代碼

Fixes #878. Ending slash in link not recognized

JC Brand 7 年之前
父節點
當前提交
edc4c1f158
共有 2 個文件被更改,包括 2 次插入1 次删除
  1. 1 0
      CHANGES.md
  2. 1 1
      src/utils.js

+ 1 - 0
CHANGES.md

@@ -6,6 +6,7 @@
 
 - Various fixes for IE11.
 - Could not register on Ejabberd 18. `"Missing attribute 'id' in tag qualified by namespace 'jabber:client'"`
+- #878 Ending slash in link not recognized
 - #959 Add padding for the iPhone X (to the mobile CSS).
 - #993 `moment.format` is not a function error when sending a message.
 - #994 TypeError when using the `user.login` API.

+ 1 - 1
src/utils.js

@@ -24,7 +24,7 @@
     const b64_sha1 = Strophe.SHA1.b64_sha1;
     Strophe = Strophe.Strophe;
 
-    const URL_REGEX = /\b(https?:\/\/|www\.|https?:\/\/www\.)[^\s<>]{2,200}\b/g;
+    const URL_REGEX = /\b(https?:\/\/|www\.|https?:\/\/www\.)[^\s<>]{2,200}\b[/]/g;
 
     const logger = _.assign({
         'debug': _.get(console, 'log') ? console.log.bind(console) : _.noop,