Skip to content

Commit 4ca9d55

Browse files
committed
fix(link): URL parsing doesn't handle uppercase and multiple links on the same line
Fix #143
1 parent da8683f commit 4ca9d55

File tree

3 files changed

+36
-36
lines changed

3 files changed

+36
-36
lines changed

package-lock.json

Lines changed: 34 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "xmpp-web",
3-
"version": "0.10.4",
3+
"version": "0.10.5",
44
"private": true,
55
"description": "Lightweight web chat client for XMPP server",
66
"homepage": "https://github.com/nioc/xmpp-web",

src/components/Message.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export default {
102102
line = lineTemp
103103
}
104104
// link
105-
line = line.replace(/(.*)((?:https?|mailto):\/\/[a-z0-9/:%_+.,#?!@&=-]+)(.*)/g, '$1<a href="$2" target="_blank" rel="noreferrer">$2</a>$3')
105+
line = line.replace(/((?:https?|mailto):\/\/[a-z0-9/:%_+.,#?!@&=-]+)/gi, '<a href="$1" target="_blank" rel="noreferrer">$1</a>')
106106
// bold
107107
line = line.replace(/([^*]*)\*([^*]*)\*([^*]*)/g, '$1<strong>$2</strong>$3')
108108
// italic

0 commit comments

Comments
 (0)