aboutsummaryrefslogtreecommitdiff
path: root/juick-www/src/main/js
diff options
context:
space:
mode:
authorGravatar KillyMXI2017-07-16 01:03:13 +0300
committerGravatar KillyMXI2017-07-17 15:07:27 +0300
commit8138f0d6a7ef65e760d6feeb2e61018f65cf0f55 (patch)
treeee5d11403bc8c4591b7f63537a7e2a9bba270971 /juick-www/src/main/js
parent17681e690eb83f02f07a3d119c9117f241ba26c1 (diff)
www: relative links
Diffstat (limited to 'juick-www/src/main/js')
-rw-r--r--juick-www/src/main/js/killy/index.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/juick-www/src/main/js/killy/index.js b/juick-www/src/main/js/killy/index.js
index 5f59225c..142d08d9 100644
--- a/juick-www/src/main/js/killy/index.js
+++ b/juick-www/src/main/js/killy/index.js
@@ -95,7 +95,7 @@ function urlReplaceInCode(match, p1, p2, p3) {
function messageReplyReplace(messageId) {
return function(match, mid, rid) {
let replyPart = (rid && rid != '0') ? '#' + rid : '';
- return `<a href="//${window.location.hostname}/${mid || messageId}${replyPart}">${match}</a>`;
+ return `<a href="/${mid || messageId}${replyPart}">${match}</a>`;
};
}
@@ -115,13 +115,13 @@ function juickFormat(txt, messageId, isCode) {
? formatText(txt, [
{ pr: 1, re: urlRe, with: urlReplaceInCode },
{ pr: 1, re: /\B(?:#(\d+))?(?:\/(\d+))?\b/g, with: messageReplyReplace(messageId) },
- { pr: 1, re: /\B@([\w-]+)\b/gi, with: '<a href="//' + window.location.hostname + '/$1">@$1</a>' },
+ { pr: 1, re: /\B@([\w-]+)\b/gi, with: '<a href="/$1">@$1</a>' },
])
: formatText(txt, [
{ pr: 0, re: /((?:^(?:>|&gt;)\s?[\s\S]+?$\n?)+)/gmi, brackets: true, with: ['<q>', '</q>', bqReplace] },
{ pr: 1, re: urlRe, with: urlReplace },
{ pr: 1, re: /\B(?:#(\d+))?(?:\/(\d+))?\b/g, with: messageReplyReplace(messageId) },
- { pr: 1, re: /\B@([\w-]+)\b/gi, with: '<a href="//' + window.location.hostname + '/$1">@$1</a>' },
+ { pr: 1, re: /\B@([\w-]+)\b/gi, with: '<a href="/$1">@$1</a>' },
{ pr: 2, re: /\B\*([^\n]+?)\*((?=\s)|(?=$)|(?=[!\"#$%&'*+,\-./:;<=>?@[\]^_`{|}~()]+))/g, brackets: true, with: ['<b>', '</b>'] },
{ pr: 2, re: /\B\/([^\n]+?)\/((?=\s)|(?=$)|(?=[!\"#$%&'*+,\-./:;<=>?@[\]^_`{|}~()]+))/g, brackets: true, with: ['<i>', '</i>'] },
{ pr: 2, re: /\b\_([^\n]+?)\_((?=\s)|(?=$)|(?=[!\"#$%&'*+,\-./:;<=>?@[\]^_`{|}~()]+))/g, brackets: true, with: ['<span class="u">', '</span>'] },