qiita-markdown 0.11.0 → 0.11.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of qiita-markdown might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dc8a158edf18ea15d3e86f7af1e12c3e2b095d47
4
- data.tar.gz: caa1625e56c23448218867cb07af95867d1ba415
3
+ metadata.gz: 6f9aec2830ebeb393f7d12ad8b568e0db39bdcbd
4
+ data.tar.gz: 14082af538813e3fefcae586794a009d55316a23
5
5
  SHA512:
6
- metadata.gz: 721727dda88455fb1a61172355bbf611b25405a15bb779b8fbf6ce011a4d4ed47f45acfba83d4b3b4638b6d7839d7c2c7d8c5176e3a784df9c9850781f777f56
7
- data.tar.gz: 4292be6a0e1295dd815b1b1d810067c71b68501c18dd8fc899faf8f6de1814f9657ad3f400616c1d884808b996c72e2433635771aad8d219b7e11d61f2ef6c2b
6
+ metadata.gz: 6e3acce6c9c3669240e6535cdcf75faeaa245334b1330be59c5b15ac18dc91bdbb28bc98c267cbb182790188aaf318fe594e11995dc05f25d88eafb537124d61
7
+ data.tar.gz: 3ed0f2a3ed5ad6c1401dc26b14dc7e91bf7e66692a69d10cccadd33c82343af3af541e090751cd066d6684328e20f05bb1874022a54579ed097bd38f924f4e39
@@ -8,3 +8,6 @@ Style/StringLiterals:
8
8
 
9
9
  Style/TrailingComma:
10
10
  EnforcedStyleForMultiline: comma
11
+
12
+ Style/UnneededPercentQ:
13
+ Enabled: false
@@ -1,3 +1,6 @@
1
+ ## 0.11.1
2
+ - Support email address link
3
+
1
4
  ## 0.11.0
2
5
  - Add `autolink` class to autolink element
3
6
  - Remove activesupport runtime dependency
@@ -3,6 +3,7 @@ module Qiita
3
3
  module Filters
4
4
  DEFAULT_LANGUAGE_ALIASES = {
5
5
  "el" => "common-lisp",
6
+ "hack" => "php",
6
7
  "zsh" => "bash",
7
8
  }
8
9
 
@@ -173,6 +173,7 @@ module Qiita
173
173
  :relative,
174
174
  "http",
175
175
  "https",
176
+ "mailto",
176
177
  ],
177
178
  },
178
179
  "img" => {
@@ -12,8 +12,12 @@ module Qiita
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)
@@ -1,5 +1,5 @@
1
1
  module Qiita
2
2
  module Markdown
3
- VERSION = "0.11.0"
3
+ VERSION = "0.11.1"
4
4
  end
5
5
  end
@@ -44,6 +44,18 @@ describe Qiita::Markdown::Processor do
44
44
  end
45
45
  end
46
46
 
47
+ context "with email address" do
48
+ let(:markdown) do
49
+ "test@example.com"
50
+ end
51
+
52
+ it "replaces with mailto link" do
53
+ should eq <<-EOS.strip_heredoc
54
+ <p><a href="mailto:test@example.com" class="autolink">test@example.com</a></p>
55
+ EOS
56
+ end
57
+ end
58
+
47
59
  context "with headings" do
48
60
  let(:markdown) do
49
61
  <<-EOS.strip_heredoc
@@ -112,6 +124,26 @@ describe Qiita::Markdown::Processor do
112
124
  end
113
125
  end
114
126
 
127
+ context "with code & filename with .php" do
128
+ let(:markdown) do
129
+ <<-EOS.strip_heredoc
130
+ ```example.php
131
+ 1
132
+ ```
133
+ EOS
134
+ end
135
+
136
+ it "returns PHP code-frame" do
137
+ should eq <<-EOS.strip_heredoc
138
+ <div class="code-frame" data-lang="php">
139
+ <div class="code-lang"><span class="bold">example.php</span></div>
140
+ <div class="highlight"><pre><span class="mi">1</span>
141
+ </pre></div>
142
+ </div>
143
+ EOS
144
+ end
145
+ end
146
+
115
147
  context "with malicious script in filename" do
116
148
  let(:markdown) do
117
149
  <<-EOS.strip_heredoc
@@ -433,18 +465,6 @@ describe Qiita::Markdown::Processor do
433
465
  end
434
466
  end
435
467
 
436
- context "with mailto: link" do
437
- let(:markdown) do
438
- "[](mailto:info@example.com)"
439
- end
440
-
441
- it "removes that link by creating empty a element" do
442
- should eq <<-EOS.strip_heredoc
443
- <p><a></a></p>
444
- EOS
445
- end
446
- end
447
-
448
468
  context "with emoji" do
449
469
  let(:markdown) do
450
470
  ":+1:"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qiita-markdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-20 00:00:00.000000000 Z
11
+ date: 2015-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gemoji
@@ -290,7 +290,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
290
290
  version: '0'
291
291
  requirements: []
292
292
  rubyforge_project:
293
- rubygems_version: 2.4.8
293
+ rubygems_version: 2.4.5
294
294
  signing_key:
295
295
  specification_version: 4
296
296
  summary: Qiita-specified markdown processor.