mato 1.0.3 → 1.1.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
  SHA1:
3
- metadata.gz: a26d6ad2db8deaef98667c703a1688fe1a92bd34
4
- data.tar.gz: 8264dd9d748373060721ed204d3c021828d7c4b1
3
+ metadata.gz: bd113838ab44d0b792e313dbbd87ea0f15aed0fe
4
+ data.tar.gz: 74113f53d71ab9114cee1d316d0500bafdf24f8e
5
5
  SHA512:
6
- metadata.gz: 0aced1f0387262f51a3ce921b60aa82585c1f997c7cf518169ef79d75d5ff91be3fb118d4f7ec22790f26d7d03a16b992b82933e6f32ddec403849dd02fd049c
7
- data.tar.gz: c4519b78c2a502f625fe98b2a3c631f29e949086edd4dd6b4adddf6ef000325c126747171220096a1562311ac6ef1ed3e09901a1f3a65244fe0c2222b5b5a42f
6
+ metadata.gz: 434e444ea0a41f79b997bdb4cf10b555cfa5f4cd3da204e831bc8268ac21cdce2e7471031515b7710baeeff10a6780f2e4f7b78f12f3cb35c53f1d27e401f21a
7
+ data.tar.gz: 14a67e122aafc2234b021343fb968b539691c69862adf89e4d471df3d29e8dae264f27c761f2d3d25ed48f460a4cdca2aad980c956dc7326763b9e35b194c33a
@@ -1,5 +1,11 @@
1
1
  # The revision history of Mato
2
2
 
3
+ ## v1.1.0 - 2017/08/24
4
+
5
+ https://github.com/bitjourney/mato/compare/v1.0.3...v1.1.0
6
+
7
+ * wrap single, bare `<img/>` with `<p/>` [#6](https://github.com/bitjourney/mato/pull/6)
8
+
3
9
  ## v1.0.3 - 2017/08/23
4
10
 
5
11
  https://github.com/bitjourney/mato/compare/v1.0.2...v1.0.3
@@ -12,6 +12,7 @@ require_relative "./mato/html_filters/syntax_highlight"
12
12
  require_relative "./mato/html_filters/task_list"
13
13
  require_relative "./mato/html_filters/section_anchor"
14
14
  require_relative "./mato/html_filters/sanitization"
15
+ require_relative "./mato/html_filters/bare_inline_element"
15
16
 
16
17
  module Mato
17
18
  # @param [Proc] block
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Wraps CommonMark's HTML blocks with <p/>.
4
+ #
5
+ # See Also:
6
+ # http://spec.commonmark.org/0.28/#html-blocks
7
+ # https://github.com/commonmark/CommonMark/issues/492
8
+ module Mato
9
+ module HtmlFilters
10
+ class BareInlineElement
11
+ STANDALONE_ININE_ELEMENTS = Set.new([
12
+ "img",
13
+ "input",
14
+ "textarea",
15
+ ])
16
+
17
+ def call(doc)
18
+ doc.children.each do |node|
19
+ if STANDALONE_ININE_ELEMENTS.include?(node.name)
20
+ parent = Nokogiri::HTML.fragment('<p/>')
21
+ parent.child.add_child(node.dup)
22
+ node.replace(parent)
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mato
4
- VERSION = "1.0.3"
4
+ VERSION = "1.1.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mato
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - FUJI Goro
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-08-23 00:00:00.000000000 Z
11
+ date: 2017-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -62,6 +62,7 @@ files:
62
62
  - lib/mato/concerns/html_node_checkable.rb
63
63
  - lib/mato/config.rb
64
64
  - lib/mato/document.rb
65
+ - lib/mato/html_filters/bare_inline_element.rb
65
66
  - lib/mato/html_filters/mention_link.rb
66
67
  - lib/mato/html_filters/sanitization.rb
67
68
  - lib/mato/html_filters/section_anchor.rb