aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/http/www/PageTemplates.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/juick/http/www/PageTemplates.java')
-rw-r--r--src/main/java/com/juick/http/www/PageTemplates.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main/java/com/juick/http/www/PageTemplates.java b/src/main/java/com/juick/http/www/PageTemplates.java
index 5d70e9de..3eb66877 100644
--- a/src/main/java/com/juick/http/www/PageTemplates.java
+++ b/src/main/java/com/juick/http/www/PageTemplates.java
@@ -19,6 +19,7 @@ package com.juick.http.www;
import com.juick.Message;
import com.juick.Tag;
+import com.juick.server.Endpoints;
import com.juick.server.MessagesQueries;
import com.juick.server.UserQueries;
import org.springframework.jdbc.core.JdbcTemplate;
@@ -375,11 +376,11 @@ public class PageTemplates {
// #12345
// <a href="http://juick.com/12345">#12345</a>
- msg = msg.replaceAll("((?<=\\s)|(?<=\\A)|(?<=\\p{Punct}))#(\\d+)((?=\\s)|(?=\\Z)|(?=\\))|(?=\\.)|(?=\\,))", "$1<a href=\"http://juick.com/$2\">#$2</a>$3");
+ msg = msg.replaceAll("((?<=\\s)|(?<=\\A)|(?<=\\p{Punct}))#(\\d+)((?=\\s)|(?=\\Z)|(?=\\))|(?=\\.)|(?=\\,))", "$1<a href=\"http://"+ Endpoints.wwwJuickCom+"/$2\">#$2</a>$3");
// #12345/65
// <a href="http://juick.com/12345#65">#12345/65</a>
- msg = msg.replaceAll("((?<=\\s)|(?<=\\A)|(?<=\\p{Punct}))#(\\d+)/(\\d+)((?=\\s)|(?=\\Z)|(?=\\p{Punct}))", "$1<a href=\"http://juick.com/$2#$3\">#$2/$3</a>$4");
+ msg = msg.replaceAll("((?<=\\s)|(?<=\\A)|(?<=\\p{Punct}))#(\\d+)/(\\d+)((?=\\s)|(?=\\Z)|(?=\\p{Punct}))", "$1<a href=\"http://"+Endpoints.wwwJuickCom+"/$2#$3\">#$2/$3</a>$4");
// *bold*
// <b>bold</b>
@@ -399,11 +400,11 @@ public class PageTemplates {
// @username@jabber.org
// <a href="http://juick.com/username@jabber.org/">@username@jabber.org</a>
- msg = msg.replaceAll("((?<=\\s)|(?<=\\A))@([\\w\\-\\.]+@[\\w\\-\\.]+)((?=\\s)|(?=\\Z)|(?=\\p{Punct}))", "$1<a href=\"http://juick.com/$2/\">@$2</a>$3");
+ msg = msg.replaceAll("((?<=\\s)|(?<=\\A))@([\\w\\-\\.]+@[\\w\\-\\.]+)((?=\\s)|(?=\\Z)|(?=\\p{Punct}))", "$1<a href=\"http://"+Endpoints.wwwJuickCom+"/$2/\">@$2</a>$3");
// @username
// <a href="http://juick.com/username/">@username</a>
- msg = msg.replaceAll("((?<=\\s)|(?<=\\A))@([\\w\\-]{2,16})((?=\\s)|(?=\\Z)|(?=\\p{Punct}))", "$1<a href=\"http://juick.com/$2/\">@$2</a>$3");
+ msg = msg.replaceAll("((?<=\\s)|(?<=\\A))@([\\w\\-]{2,16})((?=\\s)|(?=\\Z)|(?=\\p{Punct}))", "$1<a href=\"http://"+Endpoints.wwwJuickCom+"/$2/\">@$2</a>$3");
// (http://juick.com/last?page=2)
// (<a href="http://juick.com/last?page=2" rel="nofollow">juick.com</a>)