qiita-markdown 0.11.0 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of qiita-markdown might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/CHANGELOG.md +3 -0
- data/lib/qiita/markdown/filters/code.rb +1 -0
- data/lib/qiita/markdown/filters/sanitize.rb +1 -0
- data/lib/qiita/markdown/greenmat/html_renderer.rb +6 -2
- data/lib/qiita/markdown/version.rb +1 -1
- data/spec/qiita/markdown/processor_spec.rb +32 -12
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f9aec2830ebeb393f7d12ad8b568e0db39bdcbd
|
4
|
+
data.tar.gz: 14082af538813e3fefcae586794a009d55316a23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e3acce6c9c3669240e6535cdcf75faeaa245334b1330be59c5b15ac18dc91bdbb28bc98c267cbb182790188aaf318fe594e11995dc05f25d88eafb537124d61
|
7
|
+
data.tar.gz: 3ed0f2a3ed5ad6c1401dc26b14dc7e91bf7e66692a69d10cccadd33c82343af3af541e090751cd066d6684328e20f05bb1874022a54579ed097bd38f924f4e39
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -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,
|
16
|
-
|
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)
|
@@ -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.
|
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-
|
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.
|
293
|
+
rubygems_version: 2.4.5
|
294
294
|
signing_key:
|
295
295
|
specification_version: 4
|
296
296
|
summary: Qiita-specified markdown processor.
|