qiita-markdown 0.36.0 → 0.37.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: c87f030f51598557770e12094601817c916a8e468cd030aeead44855b982dd14
4
- data.tar.gz: 93a458246834fe89530ae20396dbffc98436be494331df2505359727e4fea92d
3
+ metadata.gz: a632599e029a2372e999818df8cf19474233cdafe5b0454b944d6fe93d4423ca
4
+ data.tar.gz: 6ee085f30d1b6008fe9ada38b62c91f6a7d5b68e0f656f20afdc69b5aa067c96
5
5
  SHA512:
6
- metadata.gz: c94ef6737d7881c6ab6ebb7078eb9b24be05d3804362cdde38d37f16397cb2a635f1b1d7a215d61e57effa0f1043eb2c6f901d70dff6b70ae2595e2c446208e0
7
- data.tar.gz: 7e8941da6683eb93716e05ecb89528b6208ceac2f02107c43aa3792ff6ddc302ed0fba27a7bf8a0cd488e8c66e27dc53a7c6432981e7c9b7961e24c41094cee3
6
+ metadata.gz: a7d84a2dd88cd53380b8b7c5ec3264ae3cbcdf29c718031dfb9d22038d7349ffeaa2cba6e6a8654b3d357c4c7a28994fecdc51f8381cdbff276930a4238ab866
7
+ data.tar.gz: 78bcee81ab1f08a311e7bf73f9bcbe6c79234c0ed999da679c285f10d69d482bf9c6e3373b2eb39896e2b8cdcd0890631539adf9fe6bfe69250f84ddcd1f4df1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  ## Unreleased
2
2
 
3
+ ## 0.37.0
4
+ - Change keyword of notation
5
+
3
6
  ## 0.36.0
4
7
  - Support message notation
5
8
 
@@ -2,7 +2,7 @@ module Qiita
2
2
  module Markdown
3
3
  module Filters
4
4
  class CustomBlock < HTML::Pipeline::Filter
5
- ALLOWED_TYPES = %(message).freeze
5
+ ALLOWED_TYPES = %w[note].freeze
6
6
 
7
7
  def call
8
8
  doc.search('div[data-type="customblock"]').each do |div|
@@ -24,7 +24,7 @@ module Qiita
24
24
  end
25
25
  end
26
26
 
27
- class Message
27
+ class Note
28
28
  attr_reader :node, :type
29
29
 
30
30
  ALLOWED_TYPES = %w[info warn alert].freeze
@@ -39,7 +39,7 @@ module Qiita
39
39
 
40
40
  def convert
41
41
  node.inner_html = message
42
- node["class"] = "message #{type}"
42
+ node["class"] = "note #{type}"
43
43
  node.children.first.add_previous_sibling(icon) if icon
44
44
  end
45
45
 
@@ -1,5 +1,5 @@
1
1
  module Qiita
2
2
  module Markdown
3
- VERSION = "0.36.0"
3
+ VERSION = "0.37.0"
4
4
  end
5
5
  end
@@ -1710,23 +1710,23 @@ describe Qiita::Markdown::Processor do
1710
1710
  end
1711
1711
  end
1712
1712
 
1713
- context "when type is message" do
1714
- let(:type) { "message" }
1713
+ context "when type is note" do
1714
+ let(:type) { "note" }
1715
1715
 
1716
1716
  context "when subtype is empty" do
1717
1717
  if allowed
1718
- it "returns info message block with class including icon as default type" do
1718
+ it "returns info note block with class including icon as default type" do
1719
1719
  should eq <<-HTML.strip_heredoc
1720
- <div data-type="customblock" data-metadata="message" class="message info">
1720
+ <div data-type="customblock" data-metadata="note" class="note info">
1721
1721
  <span class="fa fa-fw fa-check-circle"></span><p>Some kind of text is here.
1722
1722
  </p>
1723
1723
  </div>
1724
1724
  HTML
1725
1725
  end
1726
1726
  else
1727
- it "returns message block with class including icon" do
1727
+ it "returns note block with class including icon" do
1728
1728
  should eq <<-HTML.strip_heredoc
1729
- <div class="message info">
1729
+ <div class="note info">
1730
1730
  <span class="fa fa-fw fa-check-circle"></span><p>Some kind of text is here.
1731
1731
  </p>
1732
1732
  </div>
@@ -1739,18 +1739,18 @@ describe Qiita::Markdown::Processor do
1739
1739
  let(:subtype) { "warn" }
1740
1740
 
1741
1741
  if allowed
1742
- it "returns warning message block with class including icon" do
1742
+ it "returns warning note block with class including icon" do
1743
1743
  should eq <<-HTML.strip_heredoc
1744
- <div data-type="customblock" data-metadata="message warn" class="message warn">
1744
+ <div data-type="customblock" data-metadata="note warn" class="note warn">
1745
1745
  <span class="fa fa-fw fa-exclamation-circle"></span><p>Some kind of text is here.
1746
1746
  </p>
1747
1747
  </div>
1748
1748
  HTML
1749
1749
  end
1750
1750
  else
1751
- it "returns message block with class including icon" do
1751
+ it "returns note block with class including icon" do
1752
1752
  should eq <<-HTML.strip_heredoc
1753
- <div class="message warn">
1753
+ <div class="note warn">
1754
1754
  <span class="fa fa-fw fa-exclamation-circle"></span><p>Some kind of text is here.
1755
1755
  </p>
1756
1756
  </div>
@@ -1763,18 +1763,18 @@ describe Qiita::Markdown::Processor do
1763
1763
  let(:subtype) { "alert" }
1764
1764
 
1765
1765
  if allowed
1766
- it "returns alerting message block with class including icon" do
1766
+ it "returns alerting note block with class including icon" do
1767
1767
  should eq <<-HTML.strip_heredoc
1768
- <div data-type="customblock" data-metadata="message alert" class="message alert">
1768
+ <div data-type="customblock" data-metadata="note alert" class="note alert">
1769
1769
  <span class="fa fa-fw fa-times-circle"></span><p>Some kind of text is here.
1770
1770
  </p>
1771
1771
  </div>
1772
1772
  HTML
1773
1773
  end
1774
1774
  else
1775
- it "returns message block with class including icon" do
1775
+ it "returns note block with class including icon" do
1776
1776
  should eq <<-HTML.strip_heredoc
1777
- <div class="message alert">
1777
+ <div class="note alert">
1778
1778
  <span class="fa fa-fw fa-times-circle"></span><p>Some kind of text is here.
1779
1779
  </p>
1780
1780
  </div>
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: 0.36.0
4
+ version: 0.37.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-01 00:00:00.000000000 Z
11
+ date: 2021-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gemoji
@@ -234,7 +234,7 @@ dependencies:
234
234
  - - '='
235
235
  - !ruby/object:Gem::Version
236
236
  version: 0.49.1
237
- description:
237
+ description:
238
238
  email:
239
239
  - r7kamura@gmail.com
240
240
  executables: []
@@ -301,7 +301,7 @@ homepage: https://github.com/increments/qiita-markdown
301
301
  licenses:
302
302
  - MIT
303
303
  metadata: {}
304
- post_install_message:
304
+ post_install_message:
305
305
  rdoc_options: []
306
306
  require_paths:
307
307
  - lib
@@ -316,8 +316,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
316
316
  - !ruby/object:Gem::Version
317
317
  version: '0'
318
318
  requirements: []
319
- rubygems_version: 3.1.4
320
- signing_key:
319
+ rubygems_version: 3.0.3
320
+ signing_key:
321
321
  specification_version: 4
322
322
  summary: Qiita-specified markdown processor.
323
323
  test_files: