文章内链接自动添加 _blank

This commit is contained in:
yafeilee 2014-04-01 18:15:57 +08:00
parent c6da3ea7dc
commit 0fbc18ec9e
1 changed files with 4 additions and 0 deletions

View File

@ -3,4 +3,8 @@ require 'rouge/plugins/redcarpet'
class CodeHTML < Redcarpet::Render::HTML
include Rouge::Plugins::Redcarpet
def initialize(extensions = {})
super extensions.merge(link_attributes: { target: "_blank" })
end
end