qiita-markdown 1.3.0 → 1.5.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 57d4cba4cba7c841c19fd9e3a0933d5920f827a79acdf8bb38f511b49386282d
4
- data.tar.gz: 389ed7716950987f76db86e1a48964f3f8c59709f45479dfe15f42cb72d657d9
3
+ metadata.gz: 0cb932dbc04905b9bb5693e8121d7b093cddda21af4c7de50783f4612e31e952
4
+ data.tar.gz: 2978a8d6dcf25ffb824e34627e46cb4f51050a6c266028702d38c847ae001b53
5
5
  SHA512:
6
- metadata.gz: f811fabd2edaccff2c12d2acb74d3c40af82279a539da45b2c3a4c3362a1ac0dc7320e84ba680c4d3cbc4519eb18a3a4f50ac8308116d0064547a99abddb9fa7
7
- data.tar.gz: bf449e8687ce87e0e7b0b0fc7582c81fb5775a1ecb2a741443cfea6efa5cb795a96d2a41f528eb7b6ff669a8e862f654b2baa5799d3299e48e0c78a89e1b8f0b
6
+ metadata.gz: b4c8394799c7da3685a1e520d0f6d172ce76f715038424acef1f73ab9f2c84188ed091a5cccd60ed82da38afb23c416ee95a9282ac6b4394e5102c9b6d2db23f
7
+ data.tar.gz: ff8ed533fb59242c8e8e31d4598faa4826e5369dd12437f4e67535c1ebf6468b8b3e0a2c18ad0a388a82fd43fc8348ce46743f69b7f62b1cbca6364db61c3388
@@ -5,8 +5,8 @@ updates:
5
5
  directories:
6
6
  - "/"
7
7
  schedule:
8
- interval: "daily"
9
- time: "14:00"
8
+ interval: "weekly"
9
+ day: "sunday"
10
10
  timezone: "Asia/Tokyo"
11
11
  open-pull-requests-limit: 5
12
12
  rebase-strategy: "disabled"
@@ -15,8 +15,8 @@ updates:
15
15
  directories:
16
16
  - "/"
17
17
  schedule:
18
- interval: "daily"
19
- time: "14:00"
18
+ interval: "weekly"
19
+ day: "sunday"
20
20
  timezone: "Asia/Tokyo"
21
21
  open-pull-requests-limit: 5
22
22
  rebase-strategy: "disabled"
@@ -15,7 +15,7 @@ jobs:
15
15
 
16
16
  steps:
17
17
  - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
18
- - uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
18
+ - uses: ruby/setup-ruby@efbf473cab83af4468e8606cc33eca9281bb213f # v1.256.0
19
19
  with:
20
20
  ruby-version: 3.4.4 # Latest stable Ruby for release builds
21
21
  bundler-cache: true
@@ -11,27 +11,6 @@ permissions:
11
11
  contents: read
12
12
 
13
13
  jobs:
14
- codeclimate:
15
- runs-on: ubuntu-latest
16
- steps:
17
- - name: Get branch names
18
- id: branch-name
19
- uses: tj-actions/branch-names@dde14ac574a8b9b1cedc59a1cf312788af43d8d8 # v8.2.1
20
- - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
21
- - uses: ruby/setup-ruby@13e7a03dc3ac6c3798f4570bfead2aed4d96abfb # v1.244.0
22
- with:
23
- ruby-version: '3.2'
24
- bundler-cache: true
25
- - name: Test & publish code coverage
26
- if: "${{ env.CC_TEST_REPORTER_ID != '' }}"
27
- uses: paambaati/codeclimate-action@7bcf9e73c0ee77d178e72c0ec69f1a99c1afc1f3 # v2.7.5
28
- env:
29
- CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
30
- GIT_BRANCH: ${{ steps.branch-name.outputs.current_branch }}
31
- GIT_COMMIT_SHA: ${{ github.sha }}
32
- with:
33
- coverageCommand: bundle exec rake
34
-
35
14
  test:
36
15
  strategy:
37
16
  fail-fast: false
@@ -47,7 +26,7 @@ jobs:
47
26
  continue-on-error: ${{ matrix.experimental }}
48
27
  steps:
49
28
  - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
50
- - uses: ruby/setup-ruby@13e7a03dc3ac6c3798f4570bfead2aed4d96abfb # v1.244.0
29
+ - uses: ruby/setup-ruby@efbf473cab83af4468e8606cc33eca9281bb213f # v1.256.0
51
30
  with:
52
31
  ruby-version: ${{ matrix.ruby }}
53
32
  bundler-cache: true
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  ## Unreleased
2
2
 
3
+ ## 1.5.0
4
+
5
+ - Accept new figma script host (embed.figma.com)
6
+
7
+ ## 1.4.0
8
+
9
+ - Add support for embedding blueprintUE iframes
10
+
3
11
  ## 1.3.0
4
12
 
5
13
  - Support embedding new iframes
data/Gemfile CHANGED
@@ -5,7 +5,6 @@ gemspec
5
5
 
6
6
  gem "activesupport", "~> 5.2.7"
7
7
  gem "bundler"
8
- gem "codeclimate-test-reporter", "0.4.4"
9
8
  gem "pry"
10
9
  gem "rake"
11
10
  gem "rspec", "~> 3.1"
data/README.md CHANGED
@@ -2,8 +2,6 @@
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/qiita-markdown.svg)](https://badge.fury.io/rb/qiita-markdown)
4
4
  [![Build Status](https://travis-ci.org/increments/qiita-markdown.svg)](https://travis-ci.org/increments/qiita-markdown)
5
- [![Code Climate](https://codeclimate.com/github/increments/qiita-markdown/badges/gpa.svg)](https://codeclimate.com/github/increments/qiita-markdown)
6
- [![Test Coverage](https://codeclimate.com/github/increments/qiita-markdown/badges/coverage.svg)](https://codeclimate.com/github/increments/qiita-markdown)
7
5
 
8
6
  Qiita-specified markdown processor.
9
7
 
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Qiita
4
+ module Markdown
5
+ module Embed
6
+ module BlueprintUe
7
+ SCRIPT_HOST = "blueprintue.com"
8
+ end
9
+ end
10
+ end
11
+ end
@@ -4,7 +4,10 @@ module Qiita
4
4
  module Markdown
5
5
  module Embed
6
6
  module Figma
7
- SCRIPT_HOST = "www.figma.com"
7
+ SCRIPT_HOSTS = [
8
+ "www.figma.com",
9
+ "embed.figma.com",
10
+ ].freeze
8
11
  end
9
12
  end
10
13
  end
@@ -9,9 +9,10 @@ module Qiita
9
9
  Embed::SlideShare::SCRIPT_HOST,
10
10
  Embed::GoogleSlide::SCRIPT_HOST,
11
11
  Embed::Docswell::SCRIPT_HOSTS,
12
- Embed::Figma::SCRIPT_HOST,
12
+ Embed::Figma::SCRIPT_HOSTS,
13
13
  Embed::GoogleDrive::SCRIPT_HOST,
14
14
  Embed::StackBlitz::SCRIPT_HOST,
15
+ Embed::BlueprintUe::SCRIPT_HOST,
15
16
  ].flatten.freeze
16
17
 
17
18
  def self.call(**args)
@@ -1,5 +1,5 @@
1
1
  module Qiita
2
2
  module Markdown
3
- VERSION = "1.3.0"
3
+ VERSION = "1.5.0"
4
4
  end
5
5
  end
@@ -19,6 +19,7 @@ require "qiita/markdown/embed/speeker_deck"
19
19
  require "qiita/markdown/embed/docswell"
20
20
  require "qiita/markdown/embed/figma"
21
21
  require "qiita/markdown/embed/stack_blitz"
22
+ require "qiita/markdown/embed/blueprint_ue"
22
23
  require "qiita/markdown/transformers/filter_attributes"
23
24
  require "qiita/markdown/transformers/filter_script"
24
25
  require "qiita/markdown/transformers/filter_iframe"
@@ -1632,25 +1632,33 @@ describe Qiita::Markdown::Processor do
1632
1632
 
1633
1633
  context "with HTML embed code for Figma" do
1634
1634
  shared_examples "embed code figma example" do
1635
- let(:markdown) do
1636
- <<-MARKDOWN.strip_heredoc
1637
- <iframe style="border: 1px solid rgba(0, 0, 0, 0.1);" width="100" height="100" src="#{url}"></iframe>
1638
- MARKDOWN
1639
- end
1640
- let(:url) { "#{scheme}//www.figma.com/embed?embed_host=share&url=https%3A%2F%2Fwww.figma.com" }
1641
- let(:encoded_url) { CGI.escapeHTML(url) }
1635
+ [
1636
+ "www.figma.com/embed?embed_host=share&url=https%3A%2F%2Fwww.figma.com",
1637
+ "embed.figma.com/design/nrPSsILSYjesyc5UHjYYa4?embed_host=share",
1638
+ ].each do |script_url|
1639
+ context "with HTML embed code for Figma using script url `#{script_url}`" do
1640
+ let(:markdown) do
1641
+ <<-MARKDOWN.strip_heredoc
1642
+ <iframe style="border: 1px solid rgba(0, 0, 0, 0.1);" width="100" height="100" src="#{url}"></iframe>
1643
+ MARKDOWN
1644
+ end
1642
1645
 
1643
- if allowed
1644
- it "does not sanitize embed code" do
1645
- should eq <<-HTML.strip_heredoc
1646
- <iframe style="border: 1px solid rgba(0, 0, 0, 0.1);" width="100" height="100" src="#{encoded_url}"></iframe>
1647
- HTML
1648
- end
1649
- else
1650
- it "forces width attribute on iframe" do
1651
- should eq <<-HTML.strip_heredoc
1652
- <iframe style="border: 1px solid rgba(0, 0, 0, 0.1);" width="100%" height="100" src="#{encoded_url}"></iframe>
1653
- HTML
1646
+ let(:url) { "#{scheme}//#{script_url}" }
1647
+ let(:encoded_url) { CGI.escapeHTML(url) }
1648
+
1649
+ if allowed
1650
+ it "does not sanitize embed code" do
1651
+ should eq <<-HTML.strip_heredoc
1652
+ <iframe style="border: 1px solid rgba(0, 0, 0, 0.1);" width="100" height="100" src="#{encoded_url}"></iframe>
1653
+ HTML
1654
+ end
1655
+ else
1656
+ it "forces width attribute on iframe" do
1657
+ should eq <<-HTML.strip_heredoc
1658
+ <iframe style="border: 1px solid rgba(0, 0, 0, 0.1);" width="100%" height="100" src="#{encoded_url}"></iframe>
1659
+ HTML
1660
+ end
1661
+ end
1654
1662
  end
1655
1663
  end
1656
1664
  end
@@ -1784,6 +1792,43 @@ describe Qiita::Markdown::Processor do
1784
1792
  end
1785
1793
  end
1786
1794
 
1795
+ context "with HTML embed code for blueprintUE" do
1796
+ shared_examples "embed code blueprintUE example" do
1797
+ let(:markdown) do
1798
+ <<~MARKDOWN
1799
+ <iframe src="#{url}" width="800" height="600" frameborder="0" allowfullscreen="true"></iframe>
1800
+ MARKDOWN
1801
+ end
1802
+ let(:url) { "#{scheme}//blueprintue.com/embed/example" }
1803
+
1804
+ if allowed
1805
+ it "does not sanitize embed code" do
1806
+ should eq <<~HTML
1807
+ <iframe src="#{url}" width="800" height="600" frameborder="0" allowfullscreen="true"></iframe>
1808
+ HTML
1809
+ end
1810
+ else
1811
+ it "forces width attribute on iframe" do
1812
+ should eq <<~HTML
1813
+ <iframe src="#{url}" width="100%" height="600" frameborder="0" allowfullscreen="true"></iframe>
1814
+ HTML
1815
+ end
1816
+ end
1817
+ end
1818
+
1819
+ context "with scheme" do
1820
+ let(:scheme) { "https:" }
1821
+
1822
+ include_examples "embed code blueprintUE example"
1823
+ end
1824
+
1825
+ context "without scheme" do
1826
+ let(:scheme) { "" }
1827
+
1828
+ include_examples "embed code blueprintUE example"
1829
+ end
1830
+ end
1831
+
1787
1832
  context "with embed code for Tweet" do
1788
1833
  let(:markdown) do
1789
1834
  <<-MARKDOWN.strip_heredoc
data/spec/spec_helper.rb CHANGED
@@ -1,11 +1,6 @@
1
1
  if ENV["CI"]
2
- if ENV["GITHUB_ACTIONS"]
3
- require "simplecov"
4
- SimpleCov.start
5
- else
6
- require "codeclimate-test-reporter"
7
- CodeClimate::TestReporter.start
8
- end
2
+ require "simplecov"
3
+ SimpleCov.start
9
4
  end
10
5
 
11
6
  require "qiita-markdown"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qiita-markdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
@@ -144,6 +144,7 @@ files:
144
144
  - lib/qiita/markdown.rb
145
145
  - lib/qiita/markdown/base_processor.rb
146
146
  - lib/qiita/markdown/embed/asciinema.rb
147
+ - lib/qiita/markdown/embed/blueprint_ue.rb
147
148
  - lib/qiita/markdown/embed/code_pen.rb
148
149
  - lib/qiita/markdown/embed/docswell.rb
149
150
  - lib/qiita/markdown/embed/figma.rb