CodeColorer关键字在新窗口中打开

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填写您的邮件地址,订阅我们的精彩内容:

相关日志

回复 (1)

  1. 怡红公子  / 回复

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

发表评论 修改评论取消编辑

允许使用的标签 - 您可以在评论中使用如下的 HTML 标签以及属性。

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

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

引用通告 (0)

› 尚无引用通告。

开灯