qiita-markdown 1.1.2 → 1.2.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: ee1e7e37115360196ad00fb3c77a2c5857c46e3e201214df367d39d6f122347c
4
- data.tar.gz: 3225e9cc689488509a74fef7884bacd84a769ec8b0917c2680d09a47b82ee765
3
+ metadata.gz: c0ade2d671aa9407b7c4467426a70d4dffd0d1591549935cf079c1b58e2adb88
4
+ data.tar.gz: 3f1b894ce505d0f0703f4675e7c27908d6ef343b15a883bfd65434a084197c67
5
5
  SHA512:
6
- metadata.gz: c177b38026f17c092ac7c5896bfdf09392073a130528fa7a20917fbd859fe60bf7e68f310a1720a57d75a2e5cdf2674ed57d5d5edb23173ad0233fc15bd62115
7
- data.tar.gz: 151b887bad5f642f217e710b24c0789035c4fce9c2e44e7bd99c0b34c46eea5d6c852c02a88031ec0f20877bc83a09d4ee39fd685bf5477585798eb058639c9a
6
+ metadata.gz: 3da8566097c634c94fc622e6eeddb422a7e5fbb70ab426189fcab9ed5e94d902deb3d73638b8f2fc119c1cd8e9785db623e66f74c953ddecb539a875ce6f6f87
7
+ data.tar.gz: 3951f59e21427af26fd58ad22ed0066d590e9d0faa7f6f7a77355d5ae6cf1c48fc38f091e8e906afa0ae2c544c98519239f7fbfff285aa05d230353f8fa8d1e3
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## Unreleased
2
2
 
3
+ ## 1.2.0
4
+
5
+ - Accept new codepen script url (public.codepenassets.com)
6
+
3
7
  ## 1.1.2
4
8
 
5
9
  - Add test for code_block filter
@@ -6,6 +6,7 @@ module Qiita
6
6
  "https://production-assets.codepen.io/assets/embed/ei.js",
7
7
  "https://static.codepen.io/assets/embed/ei.js",
8
8
  "https://cpwebassets.codepen.io/assets/embed/ei.js",
9
+ "https://public.codepenassets.com/embed/index.js",
9
10
  ]
10
11
  CLASS_NAME = %w[codepen]
11
12
  DATA_ATTRIBUTES = %w[
@@ -1,5 +1,5 @@
1
1
  module Qiita
2
2
  module Markdown
3
- VERSION = "1.1.2"
3
+ VERSION = "1.2.0"
4
4
  end
5
5
  end
@@ -1406,52 +1406,34 @@ describe Qiita::Markdown::Processor do
1406
1406
  end
1407
1407
 
1408
1408
  shared_examples_for "override embed code attributes" do |allowed:|
1409
- context "with HTML embed code for CodePen using old script url" do
1410
- let(:markdown) do
1411
- <<-MARKDOWN.strip_heredoc
1412
- <p data-height="1" data-theme-id="0" data-slug-hash="foo" data-default-tab="bar" data-user="baz" data-embed-version="2" data-pen-title="qux" class="codepen"></p>
1413
- <script src="https://production-assets.codepen.io/assets/embed/ei.js"></script>
1414
- MARKDOWN
1415
- end
1416
-
1417
- if allowed
1418
- it "does not sanitize embed code" do
1419
- should eq <<-HTML.strip_heredoc
1420
- <p data-height="1" data-theme-id="0" data-slug-hash="foo" data-default-tab="bar" data-user="baz" data-embed-version="2" data-pen-title="qux" class="codepen"></p>
1421
- <script src="https://production-assets.codepen.io/assets/embed/ei.js"></script>
1422
- HTML
1423
- end
1424
- else
1425
- it "forces async attribute on script" do
1426
- should eq <<-HTML.strip_heredoc
1409
+ [
1410
+ "https://production-assets.codepen.io/assets/embed/ei.js",
1411
+ "https://static.codepen.io/assets/embed/ei.js",
1412
+ "https://cpwebassets.codepen.io/assets/embed/ei.js",
1413
+ "https://public.codepenassets.com/embed/index.js",
1414
+ ].each do |script_url|
1415
+ context "with HTML embed code for CodePen using script url `#{script_url}`" do
1416
+ let(:markdown) do
1417
+ <<-MARKDOWN.strip_heredoc
1427
1418
  <p data-height="1" data-theme-id="0" data-slug-hash="foo" data-default-tab="bar" data-user="baz" data-embed-version="2" data-pen-title="qux" class="codepen"></p>
1428
- <script src="https://production-assets.codepen.io/assets/embed/ei.js" async="async"></script>
1429
- HTML
1419
+ <script src="#{script_url}"></script>
1420
+ MARKDOWN
1430
1421
  end
1431
- end
1432
- end
1433
1422
 
1434
- context "with HTML embed code for CodePen" do
1435
- let(:markdown) do
1436
- <<-MARKDOWN.strip_heredoc
1437
- <p data-height="1" data-theme-id="0" data-slug-hash="foo" data-default-tab="bar" data-user="baz" data-embed-version="2" data-pen-title="qux" class="codepen"></p>
1438
- <script src="https://static.codepen.io/assets/embed/ei.js"></script>
1439
- MARKDOWN
1440
- end
1441
-
1442
- if allowed
1443
- it "does not sanitize embed code" do
1444
- should eq <<-HTML.strip_heredoc
1445
- <p data-height="1" data-theme-id="0" data-slug-hash="foo" data-default-tab="bar" data-user="baz" data-embed-version="2" data-pen-title="qux" class="codepen"></p>
1446
- <script src="https://static.codepen.io/assets/embed/ei.js"></script>
1447
- HTML
1448
- end
1449
- else
1450
- it "forces async attribute on script" do
1451
- should eq <<-HTML.strip_heredoc
1452
- <p data-height="1" data-theme-id="0" data-slug-hash="foo" data-default-tab="bar" data-user="baz" data-embed-version="2" data-pen-title="qux" class="codepen"></p>
1453
- <script src="https://static.codepen.io/assets/embed/ei.js" async="async"></script>
1454
- HTML
1423
+ if allowed
1424
+ it "does not sanitize embed code" do
1425
+ should eq <<-HTML.strip_heredoc
1426
+ <p data-height="1" data-theme-id="0" data-slug-hash="foo" data-default-tab="bar" data-user="baz" data-embed-version="2" data-pen-title="qux" class="codepen"></p>
1427
+ <script src="#{script_url}"></script>
1428
+ HTML
1429
+ end
1430
+ else
1431
+ it "forces async attribute on script" do
1432
+ should eq <<-HTML.strip_heredoc
1433
+ <p data-height="1" data-theme-id="0" data-slug-hash="foo" data-default-tab="bar" data-user="baz" data-embed-version="2" data-pen-title="qux" class="codepen"></p>
1434
+ <script src="#{script_url}" async="async"></script>
1435
+ HTML
1436
+ end
1455
1437
  end
1456
1438
  end
1457
1439
  end
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: 1.1.2
4
+ version: 1.2.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: 2024-04-10 00:00:00.000000000 Z
11
+ date: 2025-01-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -207,7 +207,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
207
207
  - !ruby/object:Gem::Version
208
208
  version: '0'
209
209
  requirements: []
210
- rubygems_version: 3.2.33
210
+ rubygems_version: 3.3.26
211
211
  signing_key:
212
212
  specification_version: 4
213
213
  summary: Qiita-specified markdown processor.