qiita-markdown 1.3.0 → 1.4.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: 20dde5cbdc1d2e970bb956c7b55ad0123e00dd95b2d60e4cdafd31782278c670
4
+ data.tar.gz: 4943b67271e3ad7e991815e22f867281e4e603ddb5641a013335d2d26b129089
5
5
  SHA512:
6
- metadata.gz: f811fabd2edaccff2c12d2acb74d3c40af82279a539da45b2c3a4c3362a1ac0dc7320e84ba680c4d3cbc4519eb18a3a4f50ac8308116d0064547a99abddb9fa7
7
- data.tar.gz: bf449e8687ce87e0e7b0b0fc7582c81fb5775a1ecb2a741443cfea6efa5cb795a96d2a41f528eb7b6ff669a8e862f654b2baa5799d3299e48e0c78a89e1b8f0b
6
+ metadata.gz: 971bb032fff9ca87fd6756a37c3dbae98229d2a8ae3363731252b7ad4d82924ee912ee817e1d8c9cd5f499983abae473485b7f33268805cdc5bcd21346a641c0
7
+ data.tar.gz: 8afc2a7c23fe930fd4865ff779ec4735365e565a5f09070b74b9fddb4616da613c4cfc4abc78116be759b79385ef261867275ea0f8a4f44456d282ddc3b27ce5
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## Unreleased
2
2
 
3
+ ## 1.4.0
4
+
5
+ - Add support for embedding blueprintUE iframes
6
+
3
7
  ## 1.3.0
4
8
 
5
9
  - Support embedding new iframes
@@ -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
@@ -12,6 +12,7 @@ module Qiita
12
12
  Embed::Figma::SCRIPT_HOST,
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.4.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"
@@ -1784,6 +1784,43 @@ describe Qiita::Markdown::Processor do
1784
1784
  end
1785
1785
  end
1786
1786
 
1787
+ context "with HTML embed code for blueprintUE" do
1788
+ shared_examples "embed code blueprintUE example" do
1789
+ let(:markdown) do
1790
+ <<~MARKDOWN
1791
+ <iframe src="#{url}" width="800" height="600" frameborder="0" allowfullscreen="true"></iframe>
1792
+ MARKDOWN
1793
+ end
1794
+ let(:url) { "#{scheme}//blueprintue.com/embed/example" }
1795
+
1796
+ if allowed
1797
+ it "does not sanitize embed code" do
1798
+ should eq <<~HTML
1799
+ <iframe src="#{url}" width="800" height="600" frameborder="0" allowfullscreen="true"></iframe>
1800
+ HTML
1801
+ end
1802
+ else
1803
+ it "forces width attribute on iframe" do
1804
+ should eq <<~HTML
1805
+ <iframe src="#{url}" width="100%" height="600" frameborder="0" allowfullscreen="true"></iframe>
1806
+ HTML
1807
+ end
1808
+ end
1809
+ end
1810
+
1811
+ context "with scheme" do
1812
+ let(:scheme) { "https:" }
1813
+
1814
+ include_examples "embed code blueprintUE example"
1815
+ end
1816
+
1817
+ context "without scheme" do
1818
+ let(:scheme) { "" }
1819
+
1820
+ include_examples "embed code blueprintUE example"
1821
+ end
1822
+ end
1823
+
1787
1824
  context "with embed code for Tweet" do
1788
1825
  let(:markdown) do
1789
1826
  <<-MARKDOWN.strip_heredoc
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.4.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