qiita-markdown 0.3.0 → 0.4.0
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/CHANGELOG.md +4 -0
- data/lib/qiita/markdown.rb +2 -2
- data/lib/qiita/markdown/filters/{redcarpet.rb → greenmat.rb} +6 -5
- data/lib/qiita/markdown/processor.rb +1 -1
- data/lib/qiita/markdown/summary_processor.rb +1 -1
- data/lib/qiita/markdown/version.rb +1 -1
- data/qiita-markdown.gemspec +1 -1
- data/spec/qiita/markdown/processor_spec.rb +12 -0
- metadata +13 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55dccd75f5d059bb287b744e1a2a8a458be40856
|
4
|
+
data.tar.gz: 83f59eb94a7f540e7f02ae4c7b663f2d7c3cc323
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5f152b00623f29041c972b9211543a6ded0b4d4f693b96668e2fa8f596dd0b15a12878c88dd12885dc9e1192a84320dfc29b7e5d75826f1866818e2e786d2c1
|
7
|
+
data.tar.gz: a110e9774a5be4559477e2495511375d138ee2290fe426ce971c82c54501228c955df713edec26980848016e86de64ee4fea0074357a19c686c7f96bb8f6730f
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
## Unreleased
|
2
2
|
|
3
|
+
## 0.4.0
|
4
|
+
- Replace the core renderer redcarpet with greenmat, which is a fork of redcarpet.
|
5
|
+
- Fix a bug where mentions with username including underscores (e.g. `@_username_`) was wrongly emphasized.
|
6
|
+
|
3
7
|
## 0.3.0
|
4
8
|
- Introduce another processor Qiita::Markdown::SummaryProcessor, which is for rendering a summary of markdown document.
|
5
9
|
|
data/lib/qiita/markdown.rb
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
require "active_support/core_ext/object/blank"
|
2
|
+
require "greenmat"
|
2
3
|
require "html/pipeline"
|
3
4
|
require "linguist"
|
4
5
|
require "mem"
|
5
6
|
require "nokogiri"
|
6
7
|
require "pygments"
|
7
|
-
require "redcarpet"
|
8
8
|
require "sanitize"
|
9
9
|
|
10
10
|
require "qiita/markdown/filters/checkbox"
|
11
11
|
require "qiita/markdown/filters/code"
|
12
12
|
require "qiita/markdown/filters/footnote"
|
13
|
+
require "qiita/markdown/filters/greenmat"
|
13
14
|
require "qiita/markdown/filters/mention"
|
14
|
-
require "qiita/markdown/filters/redcarpet"
|
15
15
|
require "qiita/markdown/filters/sanitize"
|
16
16
|
require "qiita/markdown/filters/simplify"
|
17
17
|
require "qiita/markdown/filters/syntax_highlight"
|
@@ -1,21 +1,22 @@
|
|
1
|
-
require "
|
1
|
+
require "greenmat"
|
2
2
|
|
3
3
|
module Qiita
|
4
4
|
module Markdown
|
5
5
|
module Filters
|
6
|
-
class
|
6
|
+
class Greenmat < HTML::Pipeline::TextFilter
|
7
7
|
class << self
|
8
8
|
# Memoize.
|
9
|
-
# @return [
|
9
|
+
# @return [Greenmat::Markdown]
|
10
10
|
def renderer
|
11
|
-
@renderer ||= ::
|
12
|
-
::
|
11
|
+
@renderer ||= ::Greenmat::Markdown.new(
|
12
|
+
::Greenmat::Render::HTML.new(
|
13
13
|
hard_wrap: true,
|
14
14
|
),
|
15
15
|
autolink: true,
|
16
16
|
fenced_code_blocks: true,
|
17
17
|
footnotes: true,
|
18
18
|
no_intra_emphasis: true,
|
19
|
+
no_mention_emphasis: true,
|
19
20
|
strikethrough: true,
|
20
21
|
tables: true,
|
21
22
|
)
|
data/qiita-markdown.gemspec
CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.add_dependency "html-pipeline"
|
23
23
|
spec.add_dependency "mem"
|
24
24
|
spec.add_dependency "pygments.rb"
|
25
|
-
spec.add_dependency "
|
25
|
+
spec.add_dependency "greenmat", ">= 3.2.0.2", "< 4"
|
26
26
|
spec.add_dependency "rugged", ">= 0.21.1b2"
|
27
27
|
spec.add_dependency "sanitize"
|
28
28
|
spec.add_development_dependency "bundler", "~> 1.7"
|
@@ -274,6 +274,18 @@ describe Qiita::Markdown::Processor do
|
|
274
274
|
end
|
275
275
|
end
|
276
276
|
|
277
|
+
context "with mention to user whose name starts and ends with underscore" do
|
278
|
+
let(:markdown) do
|
279
|
+
"@_alice_"
|
280
|
+
end
|
281
|
+
|
282
|
+
it "does not emphasize the name" do
|
283
|
+
should include(<<-EOS.strip_heredoc.rstrip)
|
284
|
+
<a href="/_alice_" class="user-mention" title="_alice_">@_alice_</a>
|
285
|
+
EOS
|
286
|
+
end
|
287
|
+
end
|
288
|
+
|
277
289
|
context "with allowed_usernames context" do
|
278
290
|
before do
|
279
291
|
context[:allowed_usernames] = ["alice"]
|
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.
|
4
|
+
version: 0.4.0
|
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-03-
|
11
|
+
date: 2015-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -95,19 +95,25 @@ dependencies:
|
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: greenmat
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
103
|
+
version: 3.2.0.2
|
104
|
+
- - "<"
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: '4'
|
104
107
|
type: :runtime
|
105
108
|
prerelease: false
|
106
109
|
version_requirements: !ruby/object:Gem::Requirement
|
107
110
|
requirements:
|
108
111
|
- - ">="
|
109
112
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
113
|
+
version: 3.2.0.2
|
114
|
+
- - "<"
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '4'
|
111
117
|
- !ruby/object:Gem::Dependency
|
112
118
|
name: rugged
|
113
119
|
requirement: !ruby/object:Gem::Requirement
|
@@ -228,8 +234,8 @@ files:
|
|
228
234
|
- lib/qiita/markdown/filters/checkbox.rb
|
229
235
|
- lib/qiita/markdown/filters/code.rb
|
230
236
|
- lib/qiita/markdown/filters/footnote.rb
|
237
|
+
- lib/qiita/markdown/filters/greenmat.rb
|
231
238
|
- lib/qiita/markdown/filters/mention.rb
|
232
|
-
- lib/qiita/markdown/filters/redcarpet.rb
|
233
239
|
- lib/qiita/markdown/filters/sanitize.rb
|
234
240
|
- lib/qiita/markdown/filters/simplify.rb
|
235
241
|
- lib/qiita/markdown/filters/syntax_highlight.rb
|
@@ -262,7 +268,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
262
268
|
version: '0'
|
263
269
|
requirements: []
|
264
270
|
rubyforge_project:
|
265
|
-
rubygems_version: 2.4.
|
271
|
+
rubygems_version: 2.4.6
|
266
272
|
signing_key:
|
267
273
|
specification_version: 4
|
268
274
|
summary: Qiita-specified markdown processor.
|
@@ -270,4 +276,3 @@ test_files:
|
|
270
276
|
- spec/qiita/markdown/processor_spec.rb
|
271
277
|
- spec/qiita/markdown/summary_processor_spec.rb
|
272
278
|
- spec/spec_helper.rb
|
273
|
-
has_rdoc:
|