From 03896ca1b912786a16017d745d5d49c6ca1e3b94 Mon Sep 17 00:00:00 2001 From: Ugnich Anton Date: Thu, 17 Apr 2014 16:37:21 +0700 Subject: Markdown links syntax --- src/java/com/juick/http/www/PageTemplates.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/java/com/juick') diff --git a/src/java/com/juick/http/www/PageTemplates.java b/src/java/com/juick/http/www/PageTemplates.java index cfdc2b0a..d88639a0 100644 --- a/src/java/com/juick/http/www/PageTemplates.java +++ b/src/java/com/juick/http/www/PageTemplates.java @@ -408,6 +408,10 @@ public class PageTemplates { // juick.com msg = msg.replaceAll("((?<=\\s)|(?<=\\A))((?:ht|f)tps?://(?:www\\.)?([^\\/\\s\\n\\\"]+)/?[^\\s\\n\\\"]*)", "$1$3"); + // [link text][http://juick.com/last?page=2] + // link text + msg = msg.replaceAll("\\[([^\\]]+)\\]\\[((?:ht|f)tps?://[^\\]]+)\\]", "$1"); + // #12345 // #12345 msg = msg.replaceAll("((?<=\\s)|(?<=\\A)|(?<=\\p{Punct}))#(\\d+)((?=\\s)|(?=\\Z)|(?=\\))|(?=\\.)|(?=\\,))", "$1#$2$3"); -- cgit v1.2.3