parent
11c804b347
commit
ff30b54130
2 changed files with 5 additions and 2 deletions
|
@ -38,7 +38,7 @@ class BBCode extends FormatterExtension {
|
|||
$text = preg_replace("/\[i\](.*?)\[\/i\]/s", "<i>\\1</i>", $text);
|
||||
$text = preg_replace("/\[u\](.*?)\[\/u\]/s", "<u>\\1</u>", $text);
|
||||
$text = preg_replace("/\[s\](.*?)\[\/s\]/s", "<s>\\1</s>", $text);
|
||||
$text = preg_replace("/>>(\d+)(#c?(\d+))?/s", "<a class='comment_link' href=\"".make_link("post/view/\\1#c\\3")."\" onclick=\"$('#c\\3').parent().effect('highlight', {}, 5000); return !$('#c\\3');\">>>\\1\\2</a>", $text);
|
||||
$text = preg_replace("/>>(\d+)(#c?(\d+))?/s", "<a class='comment_link' href=\"".make_link("post/view/\\1#c\\3")."\" onclick=\"$('#c\\3').parent().effect('highlight', {}, 5000);\">>>\\1\\2</a>", $text);
|
||||
$text = preg_replace("/(^|\s)#(\d+)/s", "\\1<a href=\"#\\2\">#\\2</a>", $text);
|
||||
$text = preg_replace("/>>([^\d].+)/", "<blockquote><small>\\1</small></blockquote>", $text);
|
||||
$text = preg_replace("/\[url=((?:https?|ftp|irc|mailto):\/\/.*?)\](.*?)\[\/url\]/s", "<a href=\"\\1\">\\2</a>", $text);
|
||||
|
|
|
@ -56,7 +56,10 @@ $(document).ready(function() {
|
|||
var target_id = $(elm).text().match(/#c?(\d+)/);
|
||||
if(target_id && $("#c"+target_id[1])) {
|
||||
var target_name = $("#c"+target_id[1]+" .username").html();
|
||||
$(elm).html("@"+target_name);
|
||||
if(target_name) {
|
||||
$(elm).attr("href", "#c"+target_id[1]);
|
||||
$(elm).html("@"+target_name);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
Reference in a new issue