Skip to content

CodeColorer关键字在新窗口中打开

2010 二月 27
by 荒野无灯

CodeColor这个插件用的是geshi代码高亮lib,因此只要修改geshi即可:
修改lib/geshi.php
第3531行:

1
  $stuff_to_parse = str_replace('<|UR1|', '<a' . $this->link_target . ' href=', $stuff_to_parse);

1
  $stuff_to_parse = str_replace('<|UR1|', '<a target="blank"' . $this->link_target . ' href=', $stuff_to_parse);

即添加一个target属性。
同理:
第3533行:

1
$stuff_to_parse = str_replace('<|UR1|', '<a' . $this->link_target . ' style="' . $this->link_styles[GESHI_LINK] . '" href=', $stuff_to_parse);

修改为:

1
$stuff_to_parse = str_replace('<|UR1|', '<a target="blank"' . $this->link_target . ' style="' . $this->link_styles[GESHI_LINK] . '" href=', $stuff_to_parse);

同理:
第3536行修改为:

1
$stuff_to_parse = str_replace('<|UR1|', '<a target="blank"' . $this->link_target . ' href=', $stuff_to_parse);

喜欢这篇文章吗?

请订阅本站 RSS feed填写您的邮件地址,订阅我们的精彩内容:,欢迎点击这里捐赠以支持荒野无灯转播到腾讯微博 转播到腾讯微博

作者:荒野无灯
出处:Hacklog【Hacklog】

声明: 本站遵循 署名-非商业性使用-相同方式共享 3.0 共享协议. 转载请注明转自Hacklog【荒野无灯weblog】

本文链接: http://ihacklog.com/?p=3438

One Response Post a comment
  1. 二月 27, 2010

    不错不错,收走了……!~~

Leave a Reply

Allowed Tags - You may use these HTML tags and attributes in your comment.

<a href="" title=""> <abbr title=""> <acronym title=""> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <q cite=""> <strong>

 :wink:  :-|  :-x  :twisted:  :)  8-O  :(  :roll:  :-P  :oops:  :-o  :mrgreen:  :lol:  :idea:  :-D  :evil:  :cry:  8)  :arrow:  :-?  :?:  :!:

Note: You may use basic HTML in your comments. Your email address will not be published.

Subscribe to this comment feed via RSS