qiita-markdown 0.40.0 → 0.42.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b1aef6d79d99a5925a9240aa6de2553ef76ca3059325df9b448a07599c42d40b
4
- data.tar.gz: 319006bd5e853597d99c87d089647f9306a5cd1fcd2e2a56763f3fc574e56f69
3
+ metadata.gz: 0430156d41ed0b17c5ba246e32ca78024e9d3fb834d8a003924a7e3526d9b278
4
+ data.tar.gz: cb4ea8e9542c5aaeffed2f8d359c06e3e72c3ff08e90f9c97cf3c6bc9c3f7f63
5
5
  SHA512:
6
- metadata.gz: a0622168bf03b042da4d02f74e190efa93842879d9705a227616149f4ce7948e043cc45b2fe8f06ecbad7acf34950c19097acd3eaab9d2136375e3c7cfe1f2f2
7
- data.tar.gz: 37728413f92234f2e18d8f76480c7be571e58496303e8256ff9c0debf11d27cad843f750907676756a7ee30bbe43b988193fc96d5099e810fcac580a284749c7
6
+ metadata.gz: 9488a97467616a4ca6e64a2483a4ba9789f3d69f1025aee5f5350a6baa6ada4e215de77af3dbb98f9ecb3a99c94680e6fc1dd7535a2acfccf70d82b1abd685db
7
+ data.tar.gz: 414798bddd8fc8d76e9f77d8165cb96907969c77b0e8c2e2678cbfeb5e44f1d43e2d888447005a1c9b7195f56e2757aa99f4ac6712933cdf5ea986ba0511d813
@@ -15,18 +15,13 @@ jobs:
15
15
  strategy:
16
16
  fail-fast: false
17
17
  matrix:
18
- os: ['ubuntu-18.04', 'macos-latest']
19
- ruby: ['2.2', '2.3', '2.4', '2.5', '2.7']
18
+ os: ['ubuntu-18.04', 'ubuntu-latest', 'macos-latest']
19
+ ruby: ['2.6', '2.7', '3.0', '3.1']
20
20
  experimental: [false]
21
21
  include:
22
- - os: 'ubuntu-18.04'
22
+ - os: 'ubuntu-latest'
23
23
  ruby: 'head'
24
24
  experimental: true
25
- exclude:
26
- - os: 'ubuntu-18.04'
27
- ruby: '2.2' # Rugged uses the wrong openssl version on CI and segfaults (similar to https://github.com/libgit2/rugged/issues/718)
28
- - os: 'ubuntu-18.04'
29
- ruby: '2.3' # Rugged uses the wrong openssl version on CI and segfaults (similar to https://github.com/libgit2/rugged/issues/718)
30
25
  runs-on: ${{ matrix.os }}
31
26
  continue-on-error: ${{ matrix.experimental }}
32
27
  steps:
data/.rubocop.yml CHANGED
@@ -1,5 +1,8 @@
1
1
  inherit_from: .rubocop_todo.yml
2
2
 
3
+ AllCops:
4
+ NewCops: enable
5
+
3
6
  Metrics/ClassLength:
4
7
  Enabled: false
5
8
 
@@ -17,7 +20,7 @@ Style/GuardClause:
17
20
  Enabled: false
18
21
 
19
22
  Style/PredicateName:
20
- NamePrefixBlacklist:
23
+ ForbiddenPrefixes:
21
24
  - is_
22
25
 
23
26
  Style/StringLiterals:
@@ -26,10 +29,13 @@ Style/StringLiterals:
26
29
  Style/TrailingCommaInArguments:
27
30
  EnforcedStyleForMultiline: comma
28
31
 
29
- Style/TrailingCommaInLiteral:
32
+ Style/TrailingCommaInHashLiteral:
33
+ EnforcedStyleForMultiline: comma
34
+
35
+ Style/TrailingCommaInArrayLiteral:
30
36
  EnforcedStyleForMultiline: comma
31
37
 
32
- Style/UnneededPercentQ:
38
+ Style/RedundantPercentQ:
33
39
  Enabled: false
34
40
 
35
41
  Metrics/LineLength:
data/.rubocop_todo.yml CHANGED
@@ -1,125 +1,352 @@
1
1
  # This configuration was generated by
2
- # `rubocop --auto-gen-config`
3
- # on 2016-05-25 17:29:05 +0900 using RuboCop version 0.40.0.
2
+ # `rubocop --auto-gen-config --exclude-limit 99999`
3
+ # on 2022-04-15 03:12:24 UTC using RuboCop version 1.27.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 4
9
+ # Offense count: 3
10
+ # This cop supports safe auto-correction (--auto-correct).
11
+ # Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include.
12
+ # Include: **/*.gemspec
13
+ Gemspec/OrderedDependencies:
14
+ Exclude:
15
+ - 'qiita-markdown.gemspec'
16
+
17
+ # Offense count: 1
18
+ # This cop supports safe auto-correction (--auto-correct).
19
+ # Configuration parameters: Include.
20
+ # Include: **/*.gemspec
21
+ Gemspec/RequireMFA:
22
+ Exclude:
23
+ - 'qiita-markdown.gemspec'
24
+
25
+ # Offense count: 1
26
+ # Configuration parameters: Include.
27
+ # Include: **/*.gemspec
28
+ Gemspec/RequiredRubyVersion:
29
+ Exclude:
30
+ - 'qiita-markdown.gemspec'
31
+
32
+ # Offense count: 1
33
+ # This cop supports safe auto-correction (--auto-correct).
34
+ Layout/ClosingHeredocIndentation:
35
+ Exclude:
36
+ - 'spec/qiita/markdown/processor_spec.rb'
37
+
38
+ # Offense count: 9
39
+ # This cop supports safe auto-correction (--auto-correct).
40
+ Layout/EmptyLineAfterGuardClause:
41
+ Exclude:
42
+ - 'lib/qiita/markdown/filters/custom_block.rb'
43
+ - 'lib/qiita/markdown/filters/external_link.rb'
44
+ - 'lib/qiita/markdown/filters/footnote.rb'
45
+ - 'lib/qiita/markdown/filters/mention.rb'
46
+ - 'lib/qiita/markdown/filters/simplify.rb'
47
+ - 'lib/qiita/markdown/transformers/filter_attributes.rb'
48
+
49
+ # Offense count: 22
50
+ # This cop supports safe auto-correction (--auto-correct).
51
+ # Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
52
+ # SupportedHashRocketStyles: key, separator, table
53
+ # SupportedColonStyles: key, separator, table
54
+ # SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
55
+ Layout/HashAlignment:
56
+ Exclude:
57
+ - 'lib/qiita/markdown/filters/user_input_sanitizer.rb'
58
+
59
+ # Offense count: 1
60
+ # This cop supports safe auto-correction (--auto-correct).
61
+ # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBrackets.
62
+ # SupportedStyles: space, no_space, compact
63
+ # SupportedStylesForEmptyBrackets: space, no_space
64
+ Layout/SpaceInsideArrayLiteralBrackets:
65
+ Exclude:
66
+ - 'lib/qiita/markdown/transformers/filter_iframe.rb'
67
+
68
+ # Offense count: 2
69
+ # This cop supports safe auto-correction (--auto-correct).
70
+ Lint/AmbiguousOperatorPrecedence:
71
+ Exclude:
72
+ - 'lib/qiita/markdown/filters/mention.rb'
73
+
74
+ # Offense count: 5
75
+ # Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
10
76
  Metrics/AbcSize:
11
- Max: 21
77
+ Max: 22
12
78
 
13
- # Offense count: 4
14
- # Configuration parameters: CountComments.
79
+ # Offense count: 10
80
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
15
81
  Metrics/MethodLength:
16
82
  Max: 20
17
83
 
84
+ # Offense count: 2
85
+ # This cop supports safe auto-correction (--auto-correct).
86
+ # Configuration parameters: EnforcedStyle, BlockForwardingName.
87
+ # SupportedStyles: anonymous, explicit
88
+ Naming/BlockForwarding:
89
+ Exclude:
90
+ - 'lib/qiita/markdown/filters/truncate.rb'
91
+
18
92
  # Offense count: 1
19
- # Cop supports --auto-correct.
20
- # Configuration parameters: EnforcedStyle, SupportedStyles.
21
- # SupportedStyles: always, conditionals
22
- Style/AndOr:
93
+ Naming/ConstantName:
23
94
  Exclude:
24
- - 'lib/qiita/markdown/filters/syntax_highlight.rb'
95
+ - 'lib/qiita/markdown/filters/mention.rb'
96
+
97
+ # Offense count: 1
98
+ # Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, CheckDefinitionPathHierarchyRoots, Regex, IgnoreExecutableScripts, AllowedAcronyms.
99
+ # CheckDefinitionPathHierarchyRoots: lib, spec, test, src
100
+ # AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
101
+ Naming/FileName:
102
+ Exclude:
103
+ - 'lib/qiita-markdown.rb'
104
+
105
+ # Offense count: 33
106
+ # Configuration parameters: ForbiddenDelimiters.
107
+ # ForbiddenDelimiters: (?-mix:(^|\s)(EO[A-Z]{1}|END)(\s|$))
108
+ Naming/HeredocDelimiterNaming:
109
+ Exclude:
110
+ - 'spec/qiita/markdown/greenmat/html_toc_renderer_spec.rb'
111
+ - 'spec/qiita/markdown/summary_processor_spec.rb'
25
112
 
26
113
  # Offense count: 3
27
- # Cop supports --auto-correct.
28
- # Configuration parameters: EnforcedStyle, SupportedStyles.
114
+ # Configuration parameters: EnforcedStyleForLeadingUnderscores.
115
+ # SupportedStylesForLeadingUnderscores: disallowed, required, optional
116
+ Naming/MemoizedInstanceVariableName:
117
+ Exclude:
118
+ - 'benchmark/heading_anchor_rendering.rb'
119
+ - 'lib/qiita/markdown/filters/greenmat.rb'
120
+ - 'lib/qiita/markdown/greenmat/heading_rendering.rb'
121
+
122
+ # Offense count: 1
123
+ # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
124
+ # AllowedNames: at, by, db, id, in, io, ip, of, on, os, pp, to
125
+ Naming/MethodParameterName:
126
+ Exclude:
127
+ - 'lib/qiita/markdown/filters/footnote.rb'
128
+
129
+ # Offense count: 3
130
+ # This cop supports safe auto-correction (--auto-correct).
131
+ # Configuration parameters: EnforcedStyle.
29
132
  # SupportedStyles: percent_q, bare_percent
30
133
  Style/BarePercentLiterals:
31
134
  Exclude:
32
135
  - 'lib/qiita/markdown/filters/syntax_highlight.rb'
33
136
 
34
137
  # Offense count: 1
35
- Style/ConstantName:
138
+ # This cop supports safe auto-correction (--auto-correct).
139
+ Style/ExpandPathArguments:
36
140
  Exclude:
37
- - 'lib/qiita/markdown/filters/mention.rb'
141
+ - 'qiita-markdown.gemspec'
38
142
 
39
- # Offense count: 3
40
- Style/DoubleNegation:
143
+ # Offense count: 47
144
+ # This cop supports safe auto-correction (--auto-correct).
145
+ # Configuration parameters: EnforcedStyle.
146
+ # SupportedStyles: always, always_true, never
147
+ Style/FrozenStringLiteralComment:
41
148
  Exclude:
149
+ - 'Gemfile'
150
+ - 'Rakefile'
42
151
  - 'benchmark/heading_anchor_rendering.rb'
152
+ - 'lib/qiita-markdown.rb'
153
+ - 'lib/qiita/markdown.rb'
154
+ - 'lib/qiita/markdown/base_processor.rb'
155
+ - 'lib/qiita/markdown/embed/asciinema.rb'
156
+ - 'lib/qiita/markdown/embed/code_pen.rb'
157
+ - 'lib/qiita/markdown/embed/google_slide.rb'
158
+ - 'lib/qiita/markdown/embed/slide_share.rb'
159
+ - 'lib/qiita/markdown/embed/speeker_deck.rb'
160
+ - 'lib/qiita/markdown/embed/tweet.rb'
161
+ - 'lib/qiita/markdown/embed/youtube.rb'
43
162
  - 'lib/qiita/markdown/filters/checkbox.rb'
163
+ - 'lib/qiita/markdown/filters/code_block.rb'
164
+ - 'lib/qiita/markdown/filters/custom_block.rb'
165
+ - 'lib/qiita/markdown/filters/emoji.rb'
166
+ - 'lib/qiita/markdown/filters/external_link.rb'
167
+ - 'lib/qiita/markdown/filters/final_sanitizer.rb'
168
+ - 'lib/qiita/markdown/filters/footnote.rb'
169
+ - 'lib/qiita/markdown/filters/greenmat.rb'
170
+ - 'lib/qiita/markdown/filters/group_mention.rb'
171
+ - 'lib/qiita/markdown/filters/image_link.rb'
172
+ - 'lib/qiita/markdown/filters/inline_code_color.rb'
173
+ - 'lib/qiita/markdown/filters/mention.rb'
174
+ - 'lib/qiita/markdown/filters/simplify.rb'
175
+ - 'lib/qiita/markdown/filters/syntax_highlight.rb'
176
+ - 'lib/qiita/markdown/filters/toc.rb'
177
+ - 'lib/qiita/markdown/filters/truncate.rb'
178
+ - 'lib/qiita/markdown/filters/user_input_sanitizer.rb'
179
+ - 'lib/qiita/markdown/greenmat/heading_rendering.rb'
180
+ - 'lib/qiita/markdown/greenmat/html_renderer.rb'
181
+ - 'lib/qiita/markdown/greenmat/html_toc_renderer.rb'
182
+ - 'lib/qiita/markdown/processor.rb'
183
+ - 'lib/qiita/markdown/summary_processor.rb'
184
+ - 'lib/qiita/markdown/transformers/filter_attributes.rb'
185
+ - 'lib/qiita/markdown/transformers/filter_iframe.rb'
186
+ - 'lib/qiita/markdown/transformers/filter_script.rb'
187
+ - 'lib/qiita/markdown/transformers/strip_invalid_node.rb'
188
+ - 'lib/qiita/markdown/version.rb'
189
+ - 'qiita-markdown.gemspec'
190
+ - 'spec/qiita/markdown/filters/greenmat_spec.rb'
191
+ - 'spec/qiita/markdown/filters/inline_code_color_spec.rb'
192
+ - 'spec/qiita/markdown/greenmat/html_toc_renderer_spec.rb'
193
+ - 'spec/qiita/markdown/processor_spec.rb'
194
+ - 'spec/qiita/markdown/summary_processor_spec.rb'
195
+ - 'spec/spec_helper.rb'
44
196
 
45
- # Offense count: 1
46
- # Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts.
47
- Style/FileName:
197
+ # Offense count: 6
198
+ # This cop supports safe auto-correction (--auto-correct).
199
+ # Configuration parameters: EnforcedShorthandSyntax, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
200
+ # SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
201
+ # SupportedShorthandSyntax: always, never, either
202
+ Style/HashSyntax:
203
+ EnforcedStyle: ruby19
204
+ EnforcedShorthandSyntax: never
205
+
206
+ # Offense count: 2
207
+ # This cop supports safe auto-correction (--auto-correct).
208
+ Style/IfUnlessModifier:
48
209
  Exclude:
49
- - 'lib/qiita-markdown.rb'
210
+ - 'lib/qiita/markdown/filters/truncate.rb'
211
+ - 'lib/qiita/markdown/transformers/strip_invalid_node.rb'
50
212
 
51
- # Offense count: 11
52
- # Cop supports --auto-correct.
213
+ # Offense count: 17
214
+ # This cop supports safe auto-correction (--auto-correct).
215
+ # Configuration parameters: EnforcedStyle.
216
+ # SupportedStyles: literals, strict
53
217
  Style/MutableConstant:
54
218
  Exclude:
55
219
  - 'lib/qiita/markdown/embed/code_pen.rb'
220
+ - 'lib/qiita/markdown/filters/group_mention.rb'
221
+ - 'lib/qiita/markdown/filters/inline_code_color.rb'
222
+ - 'lib/qiita/markdown/filters/mention.rb'
56
223
  - 'lib/qiita/markdown/embed/tweet.rb'
57
224
  - 'lib/qiita/markdown/filters/checkbox.rb'
58
225
  - 'lib/qiita/markdown/filters/code_block.rb'
59
- - 'lib/qiita/markdown/filters/sanitize.rb'
60
226
  - 'lib/qiita/markdown/filters/simplify.rb'
61
227
  - 'lib/qiita/markdown/filters/syntax_highlight.rb'
62
- - 'lib/qiita/markdown/processor.rb'
63
- - 'lib/qiita/markdown/summary_processor.rb'
64
228
  - 'lib/qiita/markdown/version.rb'
65
229
 
66
230
  # Offense count: 2
67
- # Cop supports --auto-correct.
68
- # Configuration parameters: EnforcedStyle, MinBodyLength, SupportedStyles.
231
+ # This cop supports safe auto-correction (--auto-correct).
232
+ # Configuration parameters: EnforcedStyle, MinBodyLength.
69
233
  # SupportedStyles: skip_modifier_ifs, always
70
234
  Style/Next:
71
235
  Exclude:
72
236
  - 'lib/qiita/markdown/filters/code_block.rb'
73
237
  - 'lib/qiita/markdown/filters/image_link.rb'
74
238
 
75
- # Offense count: 11
76
- # Cop supports --auto-correct.
239
+ # Offense count: 5
240
+ # This cop supports unsafe auto-correction (--auto-correct-all).
241
+ # Configuration parameters: EnforcedStyle, IgnoredMethods.
242
+ # SupportedStyles: predicate, comparison
243
+ Style/NumericPredicate:
244
+ Exclude:
245
+ - 'spec/**/*'
246
+ - 'benchmark/heading_anchor_rendering.rb'
247
+ - 'lib/qiita/markdown/greenmat/heading_rendering.rb'
248
+ - 'lib/qiita/markdown/greenmat/html_toc_renderer.rb'
249
+
250
+ # Offense count: 1
251
+ # Configuration parameters: AllowedMethods.
252
+ # AllowedMethods: respond_to_missing?
253
+ Style/OptionalBooleanParameter:
254
+ Exclude:
255
+ - 'lib/qiita/markdown/greenmat/heading_rendering.rb'
256
+
257
+ # Offense count: 1
258
+ # This cop supports safe auto-correction (--auto-correct).
259
+ Style/OrAssignment:
260
+ Exclude:
261
+ - 'lib/qiita/markdown/greenmat/html_toc_renderer.rb'
262
+
263
+ # Offense count: 9
264
+ # This cop supports safe auto-correction (--auto-correct).
77
265
  # Configuration parameters: PreferredDelimiters.
78
266
  Style/PercentLiteralDelimiters:
79
267
  Exclude:
80
268
  - 'benchmark/heading_anchor_rendering.rb'
81
269
  - 'lib/qiita/markdown/filters/mention.rb'
82
- - 'lib/qiita/markdown/filters/sanitize.rb'
83
270
  - 'lib/qiita/markdown/filters/syntax_highlight.rb'
84
271
  - 'spec/qiita/markdown/processor_spec.rb'
85
272
  - 'spec/qiita/markdown/summary_processor_spec.rb'
86
273
 
87
274
  # Offense count: 1
88
- # Cop supports --auto-correct.
275
+ # This cop supports safe auto-correction (--auto-correct).
89
276
  Style/PerlBackrefs:
90
277
  Exclude:
91
278
  - 'lib/qiita/markdown/filters/mention.rb'
92
279
 
93
280
  # Offense count: 1
94
- # Cop supports --auto-correct.
95
- # Configuration parameters: EnforcedStyle, SupportedStyles, AllowInnerSlashes.
281
+ # This cop supports unsafe auto-correction (--auto-correct-all).
282
+ # Configuration parameters: Methods.
283
+ Style/RedundantArgument:
284
+ Exclude:
285
+ - 'lib/qiita/markdown/filters/custom_block.rb'
286
+
287
+ # Offense count: 1
288
+ # This cop supports safe auto-correction (--auto-correct).
289
+ Style/RedundantRegexpCharacterClass:
290
+ Exclude:
291
+ - 'lib/qiita/markdown/filters/mention.rb'
292
+
293
+ # Offense count: 9
294
+ # This cop supports safe auto-correction (--auto-correct).
295
+ Style/RedundantRegexpEscape:
296
+ Exclude:
297
+ - 'lib/qiita/markdown/filters/group_mention.rb'
298
+ - 'lib/qiita/markdown/filters/inline_code_color.rb'
299
+
300
+ # Offense count: 4
301
+ # This cop supports safe auto-correction (--auto-correct).
302
+ # Configuration parameters: EnforcedStyle, AllowInnerSlashes.
96
303
  # SupportedStyles: slashes, percent_r, mixed
97
304
  Style/RegexpLiteral:
98
305
  Exclude:
99
- - 'lib/qiita/markdown/filters/mention.rb'
100
306
  - 'lib/qiita/markdown/filters/inline_code_color.rb'
307
+ - 'lib/qiita/markdown/filters/mention.rb'
308
+
309
+ # Offense count: 1
310
+ # This cop supports safe auto-correction (--auto-correct).
311
+ # Configuration parameters: EnforcedStyle.
312
+ # SupportedStyles: implicit, explicit
313
+ Style/RescueStandardError:
314
+ Exclude:
315
+ - 'lib/qiita/markdown/filters/syntax_highlight.rb'
316
+
317
+ # Offense count: 2
318
+ # This cop supports safe auto-correction (--auto-correct).
319
+ # Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength.
320
+ # AllowedMethods: present?, blank?, presence, try, try!
321
+ Style/SafeNavigation:
322
+ Exclude:
323
+ - 'lib/qiita/markdown/filters/custom_block.rb'
324
+ - 'lib/qiita/markdown/filters/toc.rb'
101
325
 
102
326
  # Offense count: 3
103
- # Cop supports --auto-correct.
104
- # Configuration parameters: EnforcedStyle, SupportedStyles.
327
+ # This cop supports safe auto-correction (--auto-correct).
328
+ # Configuration parameters: EnforcedStyle.
105
329
  # SupportedStyles: only_raise, only_fail, semantic
106
330
  Style/SignalException:
107
331
  Exclude:
108
332
  - 'lib/qiita/markdown/greenmat/heading_rendering.rb'
109
333
  - 'spec/qiita/markdown/summary_processor_spec.rb'
110
334
 
111
- # Offense count: 3
112
- # Cop supports --auto-correct.
113
- # Configuration parameters: EnforcedStyleForMultiline, SupportedStyles.
114
- # SupportedStyles: comma, consistent_comma, no_comma
335
+ # Offense count: 13
336
+ # This cop supports safe auto-correction (--auto-correct).
337
+ # Configuration parameters: EnforcedStyleForMultiline.
338
+ # SupportedStylesForMultiline: comma, consistent_comma, no_comma
115
339
  Style/TrailingCommaInArguments:
116
340
  Exclude:
117
341
  - 'lib/qiita/markdown/filters/mention.rb'
118
342
  - 'spec/qiita/markdown/processor_spec.rb'
119
343
 
120
- # Offense count: 9
121
- # Cop supports --auto-correct.
122
- # Configuration parameters: EnforcedStyle, SupportedStyles, MinSize, WordRegex.
344
+ # Offense count: 12
345
+ # This cop supports safe auto-correction (--auto-correct).
346
+ # Configuration parameters: EnforcedStyle, MinSize, WordRegex.
123
347
  # SupportedStyles: percent, brackets
124
348
  Style/WordArray:
125
- Enabled: false
349
+ Exclude:
350
+ - 'lib/qiita/markdown/filters/final_sanitizer.rb'
351
+ - 'lib/qiita/markdown/transformers/filter_script.rb'
352
+ - 'spec/qiita/markdown/processor_spec.rb'
data/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  ## Unreleased
2
2
 
3
+ ## 0.42.0
4
+
5
+ - Add for Ruby 3.0, 3.1 support
6
+ - Bump greenmat from 3.5.1.3 to 3.5.1.4
7
+
8
+ ## 0.41.0
9
+
10
+ - Bump greenmat from 3.5.1.2 to 3.5.1.3
11
+ - Dropping Ruby 2.5 support (#107)
12
+ - Bump rubocop from 0.40.0 to 1.7.0
13
+
14
+ ## 0.40.1
15
+
16
+ - Fix to support file names containing colons.
17
+
3
18
  ## 0.40.0
4
19
  - Change ci platform to Github Actions.
5
20
  - Fix regular expressions to detect group id(url_name) for group mention.
@@ -90,7 +90,8 @@ module Qiita
90
90
  end
91
91
 
92
92
  def sections
93
- @sections ||= (@text || "").split(":")
93
+ splited = (@text || "").split(":")
94
+ @sections ||= splited.length <= 2 ? splited : @text.split(":", 2)
94
95
  end
95
96
  end
96
97
  end
@@ -43,8 +43,8 @@ module Qiita
43
43
  end
44
44
 
45
45
  class Highlighter
46
- def self.call(*args)
47
- new(*args).call
46
+ def self.call(**args)
47
+ new(**args).call
48
48
  end
49
49
 
50
50
  def initialize(default_language: nil, node: nil, specific_language: nil)
@@ -27,8 +27,8 @@ module Qiita
27
27
 
28
28
  DELIMITER = " ".freeze
29
29
 
30
- def self.call(*args)
31
- new(*args).transform
30
+ def self.call(**args)
31
+ new(**args).transform
32
32
  end
33
33
 
34
34
  def initialize(env)
@@ -11,8 +11,8 @@ module Qiita
11
11
  Embed::GoogleSlide::SCRIPT_HOST,
12
12
  ].flatten.freeze
13
13
 
14
- def self.call(*args)
15
- new(*args).transform
14
+ def self.call(**args)
15
+ new(**args).transform
16
16
  end
17
17
 
18
18
  def initialize(env)
@@ -12,8 +12,8 @@ module Qiita
12
12
  Embed::Asciinema::SCRIPT_HOST,
13
13
  ].flatten.freeze
14
14
 
15
- def self.call(*args)
16
- new(*args).transform
15
+ def self.call(**args)
16
+ new(**args).transform
17
17
  end
18
18
 
19
19
  def initialize(env)
@@ -3,8 +3,8 @@ module Qiita
3
3
  module Transformers
4
4
  # Wraps a node env to transform invalid node.
5
5
  class StripInvalidNode
6
- def self.call(*args)
7
- new(*args).transform
6
+ def self.call(**args)
7
+ new(**args).transform
8
8
  end
9
9
 
10
10
  def initialize(env)
@@ -1,5 +1,5 @@
1
1
  module Qiita
2
2
  module Markdown
3
- VERSION = "0.40.0"
3
+ VERSION = "0.42.0"
4
4
  end
5
5
  end
@@ -16,17 +16,17 @@ Gem::Specification.new do |spec|
16
16
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
17
17
  spec.require_paths = ["lib"]
18
18
 
19
- spec.required_ruby_version = ">= 2.2.0"
19
+ spec.required_ruby_version = ">= 2.6.0"
20
20
 
21
21
  spec.add_dependency "gemoji"
22
22
  spec.add_dependency "github-linguist", "~> 4.0"
23
23
  spec.add_dependency "html-pipeline", "~> 2.0"
24
24
  spec.add_dependency "mem"
25
25
  spec.add_dependency "rouge", "3.26.0"
26
- spec.add_dependency "greenmat", "3.5.1.2"
26
+ spec.add_dependency "greenmat", "3.5.1.4"
27
27
  spec.add_dependency "sanitize"
28
28
  spec.add_dependency "addressable"
29
- spec.add_development_dependency "activesupport", "4.2.6"
29
+ spec.add_development_dependency "activesupport", "~> 5.2.7"
30
30
  spec.add_development_dependency "benchmark-ips", "~> 1.2"
31
31
  spec.add_development_dependency "bundler"
32
32
  spec.add_development_dependency "codeclimate-test-reporter", "0.4.4"
@@ -34,5 +34,5 @@ Gem::Specification.new do |spec|
34
34
  spec.add_development_dependency "pry"
35
35
  spec.add_development_dependency "rake", "~> 10.0"
36
36
  spec.add_development_dependency "rspec", "~> 3.1"
37
- spec.add_development_dependency "rubocop", "0.49.1"
37
+ spec.add_development_dependency "rubocop", "~> 1.27.0"
38
38
  end
@@ -156,6 +156,26 @@ describe Qiita::Markdown::Processor do
156
156
  end
157
157
  end
158
158
 
159
+ context "with code & filename with `:`" do
160
+ let(:markdown) do
161
+ <<-MARKDOWN.strip_heredoc
162
+ ```ruby:test:example.rb
163
+ 1
164
+ ```
165
+ MARKDOWN
166
+ end
167
+
168
+ it "returns code-frame, code-lang, and highlighted pre element" do
169
+ should eq <<-HTML.strip_heredoc
170
+ <div class="code-frame" data-lang="ruby">
171
+ <div class="code-lang"><span class="bold">test:example.rb</span></div>
172
+ <div class="highlight"><pre class="codehilite"><code><span class="mi">1</span>
173
+ </code></pre></div>
174
+ </div>
175
+ HTML
176
+ end
177
+ end
178
+
159
179
  context "with code & filename with .php" do
160
180
  let(:markdown) do
161
181
  <<-MARKDOWN.strip_heredoc
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.40.0
4
+ version: 0.42.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-06 00:00:00.000000000 Z
11
+ date: 2022-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gemoji
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: 3.5.1.2
89
+ version: 3.5.1.4
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - '='
95
95
  - !ruby/object:Gem::Version
96
- version: 3.5.1.2
96
+ version: 3.5.1.4
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: sanitize
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -126,16 +126,16 @@ dependencies:
126
126
  name: activesupport
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - '='
129
+ - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: 4.2.6
131
+ version: 5.2.7
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - '='
136
+ - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: 4.2.6
138
+ version: 5.2.7
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: benchmark-ips
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -280,17 +280,17 @@ dependencies:
280
280
  name: rubocop
281
281
  requirement: !ruby/object:Gem::Requirement
282
282
  requirements:
283
- - - '='
283
+ - - "~>"
284
284
  - !ruby/object:Gem::Version
285
- version: 0.49.1
285
+ version: 1.27.0
286
286
  type: :development
287
287
  prerelease: false
288
288
  version_requirements: !ruby/object:Gem::Requirement
289
289
  requirements:
290
- - - '='
290
+ - - "~>"
291
291
  - !ruby/object:Gem::Version
292
- version: 0.49.1
293
- description:
292
+ version: 1.27.0
293
+ description:
294
294
  email:
295
295
  - r7kamura@gmail.com
296
296
  executables: []
@@ -357,7 +357,7 @@ homepage: https://github.com/increments/qiita-markdown
357
357
  licenses:
358
358
  - MIT
359
359
  metadata: {}
360
- post_install_message:
360
+ post_install_message:
361
361
  rdoc_options: []
362
362
  require_paths:
363
363
  - lib
@@ -365,15 +365,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
365
365
  requirements:
366
366
  - - ">="
367
367
  - !ruby/object:Gem::Version
368
- version: 2.2.0
368
+ version: 2.6.0
369
369
  required_rubygems_version: !ruby/object:Gem::Requirement
370
370
  requirements:
371
371
  - - ">="
372
372
  - !ruby/object:Gem::Version
373
373
  version: '0'
374
374
  requirements: []
375
- rubygems_version: 3.0.3
376
- signing_key:
375
+ rubygems_version: 3.1.6
376
+ signing_key:
377
377
  specification_version: 4
378
378
  summary: Qiita-specified markdown processor.
379
379
  test_files: