qiita-markdown 0.38.0 → 0.40.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.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +48 -0
- data/CHANGELOG.md +11 -0
- data/lib/qiita/markdown/filters/code_block.rb +2 -1
- data/lib/qiita/markdown/filters/custom_block.rb +3 -1
- data/lib/qiita/markdown/filters/group_mention.rb +1 -1
- data/lib/qiita/markdown/version.rb +1 -1
- data/qiita-markdown.gemspec +1 -0
- data/spec/qiita/markdown/processor_spec.rb +38 -0
- data/spec/spec_helper.rb +7 -2
- metadata +60 -4
- data/.travis.yml +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc1bf2360894ec069f456681fc8c151c4c2430418be7345364059808315e0dd7
|
4
|
+
data.tar.gz: be5fa7ea995f9e9c515655cca01aaf76a8c7fbd7fc0a7337d1b02ce5f8820283
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 682d15f462913f0e419957ba8f588de8a04830ce896450cbef3e8125e3bc699bf06b0adba55a0db52281b57adc4755b7c14e4ee670762211e735624546b58218
|
7
|
+
data.tar.gz: 107ae02bc28f9a46ee09908ec469ea8f1f59902fc99da8ec152d174a25058224efe300323824c71dad6c81c671e51cfa316bcc3f9e69d388128f55c8e636804b
|
@@ -0,0 +1,48 @@
|
|
1
|
+
name: Test
|
2
|
+
|
3
|
+
on:
|
4
|
+
pull_request:
|
5
|
+
push:
|
6
|
+
branches:
|
7
|
+
- master
|
8
|
+
workflow_dispatch:
|
9
|
+
|
10
|
+
permissions:
|
11
|
+
contents: read
|
12
|
+
|
13
|
+
jobs:
|
14
|
+
test:
|
15
|
+
strategy:
|
16
|
+
fail-fast: false
|
17
|
+
matrix:
|
18
|
+
os: ['ubuntu-18.04', 'macos-latest']
|
19
|
+
ruby: ['2.2', '2.3', '2.4', '2.5', '2.7']
|
20
|
+
experimental: [false]
|
21
|
+
include:
|
22
|
+
- os: 'ubuntu-18.04'
|
23
|
+
ruby: 'head'
|
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
|
+
runs-on: ${{ matrix.os }}
|
31
|
+
continue-on-error: ${{ matrix.experimental }}
|
32
|
+
steps:
|
33
|
+
- name: Get branch names
|
34
|
+
id: branch-name
|
35
|
+
uses: tj-actions/branch-names@v4.9
|
36
|
+
- uses: actions/checkout@v2
|
37
|
+
- uses: ruby/setup-ruby@v1
|
38
|
+
with:
|
39
|
+
ruby-version: ${{ matrix.ruby }}
|
40
|
+
bundler-cache: true
|
41
|
+
- name: Test & publish code coverage
|
42
|
+
uses: paambaati/codeclimate-action@v2.7.5
|
43
|
+
env:
|
44
|
+
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
|
45
|
+
GIT_BRANCH: ${{ steps.branch-name.outputs.current_branch }}
|
46
|
+
GIT_COMMIT_SHA: ${{ github.sha }}
|
47
|
+
with:
|
48
|
+
coverageCommand: bundle exec rake
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,16 @@
|
|
1
1
|
## Unreleased
|
2
2
|
|
3
|
+
## 0.40.1
|
4
|
+
|
5
|
+
- Fix to support file names containing colons.
|
6
|
+
|
7
|
+
## 0.40.0
|
8
|
+
- Change ci platform to Github Actions.
|
9
|
+
- Fix regular expressions to detect group id(url_name) for group mention.
|
10
|
+
|
11
|
+
## 0.39.0
|
12
|
+
- Fix an error when custom block type is empty
|
13
|
+
|
3
14
|
## 0.38.0
|
4
15
|
- Change default syntax highlighter from pygments to rouge
|
5
16
|
|
@@ -18,9 +18,11 @@ module Qiita
|
|
18
18
|
attr_reader :type, :subtype
|
19
19
|
|
20
20
|
# @param text [String, nil]
|
21
|
+
# @note Attribute `type` will be nil if `text` is nil
|
22
|
+
# @note Attribute `subtype` will be nil if `text` does not include white space.
|
21
23
|
def initialize(text)
|
22
24
|
# Discared after the second word.
|
23
|
-
@type, @subtype = text.split(" ")
|
25
|
+
@type, @subtype = text && text.split(" ")
|
24
26
|
end
|
25
27
|
end
|
26
28
|
|
data/qiita-markdown.gemspec
CHANGED
@@ -30,6 +30,7 @@ Gem::Specification.new do |spec|
|
|
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"
|
33
|
+
spec.add_development_dependency "simplecov", "!= 0.18.0", "!= 0.18.1", "!= 0.18.2", "!= 0.18.3", "!= 0.18.4", "!= 0.18.5", "!= 0.19.0", "!= 0.19.1"
|
33
34
|
spec.add_development_dependency "pry"
|
34
35
|
spec.add_development_dependency "rake", "~> 10.0"
|
35
36
|
spec.add_development_dependency "rspec", "~> 3.1"
|
@@ -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
|
@@ -1690,6 +1710,24 @@ describe Qiita::Markdown::Processor do
|
|
1690
1710
|
MARKDOWN
|
1691
1711
|
end
|
1692
1712
|
|
1713
|
+
context "when type is empty" do
|
1714
|
+
if allowed
|
1715
|
+
it "returns simple div element" do
|
1716
|
+
should eq <<-HTML.strip_heredoc
|
1717
|
+
<div data-type="customblock">Some kind of text is here.
|
1718
|
+
</div>
|
1719
|
+
HTML
|
1720
|
+
end
|
1721
|
+
else
|
1722
|
+
it "returns simple div element" do
|
1723
|
+
should eq <<-HTML.strip_heredoc
|
1724
|
+
<div>Some kind of text is here.
|
1725
|
+
</div>
|
1726
|
+
HTML
|
1727
|
+
end
|
1728
|
+
end
|
1729
|
+
end
|
1730
|
+
|
1693
1731
|
context "when type is not allowed" do
|
1694
1732
|
let(:type) { "anytype" }
|
1695
1733
|
|
data/spec/spec_helper.rb
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
if ENV["CI"]
|
2
|
-
|
3
|
-
|
2
|
+
if ENV["GITHUB_ACTIONS"]
|
3
|
+
require "simplecov"
|
4
|
+
SimpleCov.start
|
5
|
+
else
|
6
|
+
require "codeclimate-test-reporter"
|
7
|
+
CodeClimate::TestReporter.start
|
8
|
+
end
|
4
9
|
end
|
5
10
|
|
6
11
|
require "qiita-markdown"
|
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.40.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:
|
11
|
+
date: 2022-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gemoji
|
@@ -178,6 +178,62 @@ dependencies:
|
|
178
178
|
- - '='
|
179
179
|
- !ruby/object:Gem::Version
|
180
180
|
version: 0.4.4
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: simplecov
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - "!="
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: 0.18.0
|
188
|
+
- - "!="
|
189
|
+
- !ruby/object:Gem::Version
|
190
|
+
version: 0.18.1
|
191
|
+
- - "!="
|
192
|
+
- !ruby/object:Gem::Version
|
193
|
+
version: 0.18.2
|
194
|
+
- - "!="
|
195
|
+
- !ruby/object:Gem::Version
|
196
|
+
version: 0.18.3
|
197
|
+
- - "!="
|
198
|
+
- !ruby/object:Gem::Version
|
199
|
+
version: 0.18.4
|
200
|
+
- - "!="
|
201
|
+
- !ruby/object:Gem::Version
|
202
|
+
version: 0.18.5
|
203
|
+
- - "!="
|
204
|
+
- !ruby/object:Gem::Version
|
205
|
+
version: 0.19.0
|
206
|
+
- - "!="
|
207
|
+
- !ruby/object:Gem::Version
|
208
|
+
version: 0.19.1
|
209
|
+
type: :development
|
210
|
+
prerelease: false
|
211
|
+
version_requirements: !ruby/object:Gem::Requirement
|
212
|
+
requirements:
|
213
|
+
- - "!="
|
214
|
+
- !ruby/object:Gem::Version
|
215
|
+
version: 0.18.0
|
216
|
+
- - "!="
|
217
|
+
- !ruby/object:Gem::Version
|
218
|
+
version: 0.18.1
|
219
|
+
- - "!="
|
220
|
+
- !ruby/object:Gem::Version
|
221
|
+
version: 0.18.2
|
222
|
+
- - "!="
|
223
|
+
- !ruby/object:Gem::Version
|
224
|
+
version: 0.18.3
|
225
|
+
- - "!="
|
226
|
+
- !ruby/object:Gem::Version
|
227
|
+
version: 0.18.4
|
228
|
+
- - "!="
|
229
|
+
- !ruby/object:Gem::Version
|
230
|
+
version: 0.18.5
|
231
|
+
- - "!="
|
232
|
+
- !ruby/object:Gem::Version
|
233
|
+
version: 0.19.0
|
234
|
+
- - "!="
|
235
|
+
- !ruby/object:Gem::Version
|
236
|
+
version: 0.19.1
|
181
237
|
- !ruby/object:Gem::Dependency
|
182
238
|
name: pry
|
183
239
|
requirement: !ruby/object:Gem::Requirement
|
@@ -241,11 +297,11 @@ executables: []
|
|
241
297
|
extensions: []
|
242
298
|
extra_rdoc_files: []
|
243
299
|
files:
|
300
|
+
- ".github/workflows/test.yml"
|
244
301
|
- ".gitignore"
|
245
302
|
- ".rspec"
|
246
303
|
- ".rubocop.yml"
|
247
304
|
- ".rubocop_todo.yml"
|
248
|
-
- ".travis.yml"
|
249
305
|
- CHANGELOG.md
|
250
306
|
- Gemfile
|
251
307
|
- LICENSE.txt
|
@@ -316,7 +372,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
316
372
|
- !ruby/object:Gem::Version
|
317
373
|
version: '0'
|
318
374
|
requirements: []
|
319
|
-
rubygems_version: 3.
|
375
|
+
rubygems_version: 3.1.4
|
320
376
|
signing_key:
|
321
377
|
specification_version: 4
|
322
378
|
summary: Qiita-specified markdown processor.
|
data/.travis.yml
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
sudo: false
|
2
|
-
addons:
|
3
|
-
apt:
|
4
|
-
packages:
|
5
|
-
- libicu-dev
|
6
|
-
before_install:
|
7
|
-
- gem update bundler
|
8
|
-
language: ruby
|
9
|
-
rvm:
|
10
|
-
- 2.2
|
11
|
-
- 2.3
|
12
|
-
- 2.4
|
13
|
-
env:
|
14
|
-
global:
|
15
|
-
secure: n8eyxYYfxLApgR4YGKqbrOgGlraIyLyoql4K4DvLZV4kqfGf9LLsPdP7Shudqrv5k2h8xIwnJVnwcPZx9YCu5WWYrJd7vmivpU2j52LwFPYRM+GFNcu7TXmzcNSPG8agnc5We9amF5zJY6XSTpzWpxyqfIwEZM75iR6XXuHuLFk=
|
16
|
-
cache: bundler
|