File tree Expand file tree Collapse file tree 4 files changed +50
-0
lines changed Expand file tree Collapse file tree 4 files changed +50
-0
lines changed Original file line number Diff line number Diff line change 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"
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ class FilterIframe
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 )
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments