From 4295e1c827fd3882bb3f683802912d85d858efb6 Mon Sep 17 00:00:00 2001 From: rr- Date: Sun, 12 Jun 2016 18:12:00 +0200 Subject: [PATCH] client/misc: fix Markdown permalinks --- client/js/util/misc.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/js/util/misc.js b/client/js/util/misc.js index 54c07315..a9521458 100644 --- a/client/js/util/misc.js +++ b/client/js/util/misc.js @@ -111,9 +111,9 @@ function formatMarkdown(text) { text = text.replace( /(^|^\(|(?:[^\]])\(|[\s<>\[\]\)])([+#@][a-zA-Z0-9_-]+)/g, '$1[$2]($2)'); - text = text.replace(/\]\(@(\d+)\)/g, '](#/post/$1)'); - text = text.replace(/\]\(\+([a-zA-Z0-9_-]+)\)/g, '](#/user/$1)'); - text = text.replace(/\]\(#([a-zA-Z0-9_-]+)\)/g, '](#/posts/query=$1)'); + text = text.replace(/\]\(@(\d+)\)/g, '](/post/$1)'); + text = text.replace(/\]\(\+([a-zA-Z0-9_-]+)\)/g, '](/user/$1)'); + text = text.replace(/\]\(#([a-zA-Z0-9_-]+)\)/g, '](/posts/text=$1)'); return text; }; @@ -131,7 +131,7 @@ function formatMarkdown(text) { //search permalinks text = text.replace( /\[search\]((?:[^\[]|\[(?!\/?search\]))+)\[\/search\]/ig, - '$1'); + '$1'); //spoilers text = text.replace( /\[spoiler\]((?:[^\[]|\[(?!\/?spoiler\]))+)\[\/spoiler\]/ig,