github-markdown-preview 4.0.2 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -2
- data/github-markdown-preview.gemspec +8 -7
- data/lib/github-markdown-preview/filter/task_list_filter.rb +2 -2
- data/lib/github-markdown-preview/html_preview.rb +1 -1
- data/lib/github-markdown-preview/version.rb +1 -1
- data/test/github-markdown-preview_test.rb +3 -3
- data/test/html_preview_test.rb +20 -3
- metadata +31 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16a77175ce74a40423b081a32a8ba5c67012cdfb
|
4
|
+
data.tar.gz: f0369896b7974b963b65c610f716e62229ec4516
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0e3f358a6887ad3bedda738cba02855214efd6bc661539fa6d9b9c83a10980597f441bff66b1cf7f94bca2d9212512359913fd7f5ea249ad228af80aeb59a0b
|
7
|
+
data.tar.gz: 66839cc3b4cb75e84a3b297f2e1d0d7e100d18330f258cdaed83cfb564d9d5d4635d9a3b5a32ae5598201aa4bf3b585f5933e53b7e5add5066b6f82807c0dcb7
|
data/.travis.yml
CHANGED
@@ -13,14 +13,15 @@ Gem::Specification.new do |s|
|
|
13
13
|
s.description = %q{Local previews for Github markdown}
|
14
14
|
s.license = 'MIT'
|
15
15
|
|
16
|
-
s.add_dependency 'listen', '3.
|
17
|
-
s.add_dependency 'html-pipeline', '2.
|
18
|
-
s.add_dependency '
|
19
|
-
s.add_dependency '
|
20
|
-
s.add_dependency '
|
16
|
+
s.add_dependency 'listen', '3.1.5'
|
17
|
+
s.add_dependency 'html-pipeline', '2.7.1'
|
18
|
+
s.add_dependency 'commonmarker', '0.17.9'
|
19
|
+
s.add_dependency 'sanitize', '4.6.4'
|
20
|
+
s.add_dependency 'github-markdown', '0.6.9'
|
21
|
+
s.add_dependency 'gemoji', '3.0.0'
|
21
22
|
|
22
|
-
s.add_development_dependency 'minitest', '~> 5.
|
23
|
-
s.add_development_dependency 'rake', '~>
|
23
|
+
s.add_development_dependency 'minitest', '~> 5.11.3'
|
24
|
+
s.add_development_dependency 'rake', '~> 12.3.1'
|
24
25
|
|
25
26
|
s.files = `git ls-files`.split("\n")
|
26
27
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
@@ -35,8 +35,8 @@ module GithubMarkdownPreview
|
|
35
35
|
(first_child.ancestors('ul').first || { })['class'] = 'task-list'
|
36
36
|
first_child.replace(html)
|
37
37
|
end
|
38
|
-
doc.search('ul/li').each
|
39
|
-
doc.search('ul/li/p').each
|
38
|
+
doc.search('ul/li').each(&process_task)
|
39
|
+
doc.search('ul/li/p').each(&process_task)
|
40
40
|
doc
|
41
41
|
end
|
42
42
|
|
@@ -7,19 +7,19 @@ class TestBin < Minitest::Test
|
|
7
7
|
|
8
8
|
def test_no_params
|
9
9
|
IO.popen("bundle exec #{@ghp_scipt}") do |io|
|
10
|
-
assert_match
|
10
|
+
assert_match(/Usage.*/, io.read, 'No parameter call should output usage')
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
14
|
def test_version_ouput
|
15
15
|
IO.popen("bundle exec #{@ghp_scipt} -v") do |io|
|
16
|
-
assert_match
|
16
|
+
assert_match(GithubMarkdownPreview::VERSION, io.read, '-v call should output version')
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
20
|
def test_file_not_found
|
21
21
|
IO.popen("bundle exec #{@ghp_scipt} this_file_does_not_exist 2>&1") do |io|
|
22
|
-
assert_match
|
22
|
+
assert_match(/.*No such file/, io.read, 'Bad file name should get a helpful error')
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
data/test/html_preview_test.rb
CHANGED
@@ -74,7 +74,13 @@ class TestHtmlPreview < Minitest::Test
|
|
74
74
|
def test_default_mode_anchors
|
75
75
|
write(@source_file_path, "# foo\n## bar")
|
76
76
|
markdown_preview = @ghp.new( @source_file_path )
|
77
|
-
|
77
|
+
html = <<HTML
|
78
|
+
<h1>
|
79
|
+
<a id=\"foo\" class=\"anchor\" href=\"#foo\" aria-hidden=\"true\"><span aria-hidden=\"true\" class=\"octicon octicon-link\"></span></a>foo</h1>
|
80
|
+
<h2>
|
81
|
+
<a id=\"bar\" class=\"anchor\" href=\"#bar\" aria-hidden=\"true\"><span aria-hidden=\"true\" class=\"octicon octicon-link\"></span></a>bar</h2>
|
82
|
+
HTML
|
83
|
+
assert_equal markdown_preview.wrap_preview(html.chomp),
|
78
84
|
read(markdown_preview.preview_file),
|
79
85
|
'Should contain anchor link markup in default mode'
|
80
86
|
end
|
@@ -82,7 +88,7 @@ class TestHtmlPreview < Minitest::Test
|
|
82
88
|
def test_comment_mode_anchors
|
83
89
|
write(@source_file_path, "# foo\n## bar")
|
84
90
|
markdown_preview = @ghp.new( @source_file_path, { :comment_mode => true } )
|
85
|
-
assert_equal markdown_preview.wrap_preview("<h1>foo</h1>\n
|
91
|
+
assert_equal markdown_preview.wrap_preview("<h1>foo</h1>\n<h2>bar</h2>"),
|
86
92
|
read(markdown_preview.preview_file),
|
87
93
|
'Should NOT contain anchor link markup in comment mode'
|
88
94
|
end
|
@@ -106,7 +112,18 @@ class TestHtmlPreview < Minitest::Test
|
|
106
112
|
def test_double_spaced_task_lists
|
107
113
|
write(@source_file_path, "- [ ] one\n\n- [ ] two")
|
108
114
|
markdown_preview = @ghp.new( @source_file_path, { :comment_mode => true } )
|
109
|
-
|
115
|
+
html = <<HTML
|
116
|
+
<ul class=\"task-list\">
|
117
|
+
<li class=\"task-list-item\">
|
118
|
+
<p><input class=\"task-list-item-checkbox\" type=\"checkbox\"> one</p>
|
119
|
+
</li>
|
120
|
+
<li class=\"task-list-item\">
|
121
|
+
<p><input class=\"task-list-item-checkbox\" type=\"checkbox\"> two</p>
|
122
|
+
</li>
|
123
|
+
</ul>
|
124
|
+
HTML
|
125
|
+
|
126
|
+
assert_equal markdown_preview.wrap_preview(html.chomp),
|
110
127
|
read(markdown_preview.preview_file),
|
111
128
|
'Should render tasks even if list has extra spaces (which render as <p> elements)'
|
112
129
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: github-markdown-preview
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 5.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Marcotte
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-05-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: listen
|
@@ -16,98 +16,112 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 3.
|
19
|
+
version: 3.1.5
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 3.
|
26
|
+
version: 3.1.5
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: html-pipeline
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 2.7.1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 2.7.1
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: commonmarker
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.17.9
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.17.9
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: sanitize
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
44
58
|
requirements:
|
45
59
|
- - '='
|
46
60
|
- !ruby/object:Gem::Version
|
47
|
-
version: 4.
|
61
|
+
version: 4.6.4
|
48
62
|
type: :runtime
|
49
63
|
prerelease: false
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
66
|
- - '='
|
53
67
|
- !ruby/object:Gem::Version
|
54
|
-
version: 4.
|
68
|
+
version: 4.6.4
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: github-markdown
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
58
72
|
requirements:
|
59
73
|
- - '='
|
60
74
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.6.
|
75
|
+
version: 0.6.9
|
62
76
|
type: :runtime
|
63
77
|
prerelease: false
|
64
78
|
version_requirements: !ruby/object:Gem::Requirement
|
65
79
|
requirements:
|
66
80
|
- - '='
|
67
81
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0.6.
|
82
|
+
version: 0.6.9
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: gemoji
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
72
86
|
requirements:
|
73
87
|
- - '='
|
74
88
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
89
|
+
version: 3.0.0
|
76
90
|
type: :runtime
|
77
91
|
prerelease: false
|
78
92
|
version_requirements: !ruby/object:Gem::Requirement
|
79
93
|
requirements:
|
80
94
|
- - '='
|
81
95
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
96
|
+
version: 3.0.0
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: minitest
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
86
100
|
requirements:
|
87
101
|
- - "~>"
|
88
102
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
103
|
+
version: 5.11.3
|
90
104
|
type: :development
|
91
105
|
prerelease: false
|
92
106
|
version_requirements: !ruby/object:Gem::Requirement
|
93
107
|
requirements:
|
94
108
|
- - "~>"
|
95
109
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
110
|
+
version: 5.11.3
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: rake
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
100
114
|
requirements:
|
101
115
|
- - "~>"
|
102
116
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
117
|
+
version: 12.3.1
|
104
118
|
type: :development
|
105
119
|
prerelease: false
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
107
121
|
requirements:
|
108
122
|
- - "~>"
|
109
123
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
124
|
+
version: 12.3.1
|
111
125
|
description: Local previews for Github markdown
|
112
126
|
email: dmarcotte@gmail.com
|
113
127
|
executables:
|
@@ -158,7 +172,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
158
172
|
version: '0'
|
159
173
|
requirements: []
|
160
174
|
rubyforge_project:
|
161
|
-
rubygems_version: 2.
|
175
|
+
rubygems_version: 2.6.14
|
162
176
|
signing_key:
|
163
177
|
specification_version: 4
|
164
178
|
summary: Use your favorite editor plus the usual edit/refresh cycle to quickly write
|