There are currently 6 posts.
Font size: Small - 100% (Default)  Content converter: No conversion
 
Clicks Replies
1614 5
顺便再提个建议!
張樹人
初级工程师 九级
Reply
Floor 1 Posted at: 11/25/10 16:48
希望能够把带链接的帖子中的链接自动变成蓝色的可点击的样子~~就像百度那样。
经测试,在ie中发链接能变蓝,但在FF中发链接还是黑的:
http://www.baidu.com
61.188.48.*
Reply
Floor 2 Posted at: 11/25/10 18:29
哦,貌似很麻烦。
61.188.48.*
Reply
Floor 3 Posted at: 11/25/10 18:31

正则表达式虽然能匹配字符串,但……

有了!用$1

比如匹配到了http://tieba.blue.cat/post.php?i=7636,则自动替换为<a href="http://tieba.blue.cat/post.php?i=7636" target="_blank">http://tieba.blue.cat/post.php?i=7636</a>

用<a href="$1" target="_blank">$1</a>就行了。

$1表示匹配得到的url

61.188.48.*
Reply
Floor 4 Posted at: 11/25/10 18:32
本站不像百度那样恨链接。在百度发链接4帖以上就会被jsp自动封禁。
張樹人
初级工程师 九级
Reply
Floor 5 Posted at: 11/25/10 22:31
http://www.test.com
張樹人
初级工程师 九级
Reply
Floor 6 Posted at: 11/25/10 22:31

回复:5楼

貌似还没自动变成链接的说。。。

Reply the post
Content:
User: You are currently anonymous.
Captcha:
Unclear? Try another one.
(Shortcut key: Ctrl+Enter)
Post Information
Clicks: 1614 Replies: 5
Author: 張樹人
Last reply: 張樹人
Last reply time: 11/25/10 22:31
Good area: 已处理区
Bar Hot Posts
Bar Good Posts
Announcements