File tree 2 files changed +7
-3
lines changed
lib/qiita/markdown/greenmat
2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -12,8 +12,12 @@ def initialize(extensions = {})
12
12
end
13
13
14
14
# https://github.com/vmg/redcarpet/blob/v3.2.3/ext/redcarpet/html.c#L76-L116
15
- def autolink ( link , _link_type )
16
- %(<a href="#{ link } " class="autolink">#{ link } </a>)
15
+ def autolink ( link , link_type )
16
+ if link_type == :email
17
+ %(<a href="mailto:#{ link } " class="autolink">#{ link } </a>)
18
+ else
19
+ %(<a href="#{ link } " class="autolink">#{ link } </a>)
20
+ end
17
21
end
18
22
19
23
def header ( text , level )
Original file line number Diff line number Diff line change 51
51
52
52
it "replaces with mailto link" do
53
53
should eq <<-EOS . strip_heredoc
54
- <p><a href="mailto:test@example.com">test@example.com</a></p>
54
+ <p><a href="mailto:test@example.com" class="autolink" >test@example.com</a></p>
55
55
EOS
56
56
end
57
57
end
You can’t perform that action at this time.
0 commit comments