qiita-markdown 1.6.1 → 1.7.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 +4 -4
- data/.github/workflows/release.yml +3 -3
- data/.github/workflows/test.yml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile +2 -2
- data/lib/qiita/markdown/embed/claude_artifact.rb +11 -0
- data/lib/qiita/markdown/transformers/filter_iframe.rb +1 -0
- data/lib/qiita/markdown/version.rb +1 -1
- data/lib/qiita/markdown.rb +1 -0
- data/spec/qiita/markdown/processor_spec.rb +37 -0
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a89cc560d54939b287952f11525a3d17e341bb47fe86d16e1b01a6ac157cd6cf
|
|
4
|
+
data.tar.gz: d8e08ae41ef4354d5f2629c35857e009d621aad4bc1ca561c90efaa061490b72
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6a8c679036b1c42c02cddd1542c98d5edd084b053ce91d20e4aa8aefa28c840c81526efcc438277938cae72b5a3957ef4d45df1955acfd113664d97e8514ec35
|
|
7
|
+
data.tar.gz: 29fdc8c15cd3208c60cd8dbdf470a52962bb0fe010d9e4a5323e6cbc5b26cd7782313487a27ff4495cbaa9d0d4679c371ff9e66644b1662eb2ef530e4a70281f
|
|
@@ -14,9 +14,9 @@ jobs:
|
|
|
14
14
|
contents: write # IMPORTANT: this permission is required for `rake release` to push the release tag
|
|
15
15
|
|
|
16
16
|
steps:
|
|
17
|
-
- uses: actions/checkout@
|
|
18
|
-
- uses: ruby/setup-ruby@
|
|
17
|
+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
18
|
+
- uses: ruby/setup-ruby@d5126b9b3579e429dd52e51e68624dda2e05be25 # v1.267.0
|
|
19
19
|
with:
|
|
20
20
|
ruby-version: 3.4.4 # Latest stable Ruby for release builds
|
|
21
21
|
bundler-cache: true
|
|
22
|
-
- uses: rubygems/release-gem@
|
|
22
|
+
- uses: rubygems/release-gem@1c162a739e8b4cb21a676e97b087e8268d8fc40b # v1.1.2
|
data/.github/workflows/test.yml
CHANGED
|
@@ -25,8 +25,8 @@ jobs:
|
|
|
25
25
|
runs-on: ${{ matrix.os }}
|
|
26
26
|
continue-on-error: ${{ matrix.experimental }}
|
|
27
27
|
steps:
|
|
28
|
-
- uses: actions/checkout@
|
|
29
|
-
- uses: ruby/setup-ruby@
|
|
28
|
+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
29
|
+
- uses: ruby/setup-ruby@d5126b9b3579e429dd52e51e68624dda2e05be25 # v1.267.0
|
|
30
30
|
with:
|
|
31
31
|
ruby-version: ${{ matrix.ruby }}
|
|
32
32
|
bundler-cache: true
|
|
@@ -36,8 +36,8 @@ jobs:
|
|
|
36
36
|
qlty:
|
|
37
37
|
runs-on: ubuntu-latest
|
|
38
38
|
steps:
|
|
39
|
-
- uses: actions/checkout@
|
|
40
|
-
- uses: ruby/setup-ruby@
|
|
39
|
+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
40
|
+
- uses: ruby/setup-ruby@d5126b9b3579e429dd52e51e68624dda2e05be25 # v1.267.0
|
|
41
41
|
with:
|
|
42
42
|
ruby-version: '3.2'
|
|
43
43
|
bundler-cache: true
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
|
@@ -3,11 +3,11 @@ source "https://rubygems.org"
|
|
|
3
3
|
# Specify your gem's dependencies in qiita-markdown.gemspec
|
|
4
4
|
gemspec
|
|
5
5
|
|
|
6
|
-
gem "activesupport", "~>
|
|
6
|
+
gem "activesupport", "~> 7.1.6"
|
|
7
7
|
gem "bundler"
|
|
8
8
|
gem "pry"
|
|
9
9
|
gem "rake"
|
|
10
10
|
gem "rspec", "~> 3.1"
|
|
11
|
-
gem "rubocop", "~> 1.
|
|
11
|
+
gem "rubocop", "~> 1.81.6"
|
|
12
12
|
gem "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"
|
|
13
13
|
gem "simplecov_json_formatter"
|
data/lib/qiita/markdown.rb
CHANGED
|
@@ -20,6 +20,7 @@ require "qiita/markdown/embed/docswell"
|
|
|
20
20
|
require "qiita/markdown/embed/figma"
|
|
21
21
|
require "qiita/markdown/embed/stack_blitz"
|
|
22
22
|
require "qiita/markdown/embed/blueprint_ue"
|
|
23
|
+
require "qiita/markdown/embed/claude_artifact"
|
|
23
24
|
require "qiita/markdown/transformers/filter_attributes"
|
|
24
25
|
require "qiita/markdown/transformers/filter_script"
|
|
25
26
|
require "qiita/markdown/transformers/filter_iframe"
|
|
@@ -1829,6 +1829,43 @@ describe Qiita::Markdown::Processor do
|
|
|
1829
1829
|
end
|
|
1830
1830
|
end
|
|
1831
1831
|
|
|
1832
|
+
context "with HTML embed code for Claude Artifact" do
|
|
1833
|
+
shared_examples "embed code claude artifact example" do
|
|
1834
|
+
let(:markdown) do
|
|
1835
|
+
<<~MARKDOWN
|
|
1836
|
+
<iframe src="#{url}" width="100%" height="600" frameborder="0" allowfullscreen></iframe>
|
|
1837
|
+
MARKDOWN
|
|
1838
|
+
end
|
|
1839
|
+
let(:url) { "#{scheme}//claude.site/public/artifacts/4f47d0d5-3be1-41da-a871-df530aae8f54/embed" }
|
|
1840
|
+
|
|
1841
|
+
if allowed
|
|
1842
|
+
it "does not sanitize embed code" do
|
|
1843
|
+
should eq <<~HTML
|
|
1844
|
+
<iframe src="#{url}" width="100%" height="600" frameborder="0" allowfullscreen></iframe>
|
|
1845
|
+
HTML
|
|
1846
|
+
end
|
|
1847
|
+
else
|
|
1848
|
+
it "forces width attribute on iframe" do
|
|
1849
|
+
should eq <<~HTML
|
|
1850
|
+
<iframe src="#{url}" width="100%" height="600" frameborder="0" allowfullscreen></iframe>
|
|
1851
|
+
HTML
|
|
1852
|
+
end
|
|
1853
|
+
end
|
|
1854
|
+
end
|
|
1855
|
+
|
|
1856
|
+
context "with scheme" do
|
|
1857
|
+
let(:scheme) { "https:" }
|
|
1858
|
+
|
|
1859
|
+
include_examples "embed code claude artifact example"
|
|
1860
|
+
end
|
|
1861
|
+
|
|
1862
|
+
context "without scheme" do
|
|
1863
|
+
let(:scheme) { "" }
|
|
1864
|
+
|
|
1865
|
+
include_examples "embed code claude artifact example"
|
|
1866
|
+
end
|
|
1867
|
+
end
|
|
1868
|
+
|
|
1832
1869
|
context "with embed code for Tweet" do
|
|
1833
1870
|
let(:markdown) do
|
|
1834
1871
|
<<-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.
|
|
4
|
+
version: 1.7.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ryo Nakamura
|
|
@@ -159,6 +159,7 @@ files:
|
|
|
159
159
|
- lib/qiita/markdown/base_processor.rb
|
|
160
160
|
- lib/qiita/markdown/embed/asciinema.rb
|
|
161
161
|
- lib/qiita/markdown/embed/blueprint_ue.rb
|
|
162
|
+
- lib/qiita/markdown/embed/claude_artifact.rb
|
|
162
163
|
- lib/qiita/markdown/embed/code_pen.rb
|
|
163
164
|
- lib/qiita/markdown/embed/docswell.rb
|
|
164
165
|
- lib/qiita/markdown/embed/figma.rb
|