Typecho版本 1.0 (14.10.10)文章的超链接点击之后默认会在当前页面打开,搜索了一下改默认新页面打开
在 \var\CommonMark\HtmlRenderer.php 的104行处,添加一段代码:$attrs['target'] = '_blank';
即可。
以下是修改后的代码:
case CommonMark_Element_InlineElement::TYPE_LINK:
$attrs['href'] = $this->escape($inline->getAttribute('destination'), true);
if ($title = $inline->getAttribute('title')) {
$attrs['title'] = $this->escape($title, true);
}
$attrs['target'] = '_blank'; #添加这一行代码链接默认新窗口打开
return $this->inTags('a', $attrs, $this->renderInlines($inline->getAttribute('label')));