reverse_markdown 1.4.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1945214c22af9c763471e6bf9375fe94f1618fd67af1de2a28a0c88cdc59c07a
4
- data.tar.gz: 26352feda47de16934757ade063ec14d55a9a6c8364570a9b3b72c656deb803b
3
+ metadata.gz: 9ef774cdac53cd6e678d86a0b0532bb7ab080870ade2d7a4ea924244ce2e1b2d
4
+ data.tar.gz: fac03bd80d37d2a2845e7eac16416a25cb525ce6e9b91839fbcfdf3f977a1863
5
5
  SHA512:
6
- metadata.gz: 959cc8dff7496eec2b8828f6f059ababa4d008fe6b5aebc05d442b6c746b4d863b1f860f29c5620738273ed808a21b9a19182283d2c177e8b86d0553e53f01ad
7
- data.tar.gz: 2580ead64498f94190f4e20cb3a475e1e8e5dc7f3343fe8d7ea4fcb4a7d9a163628facdb0eb00ad2b335edc3b9758dc83389c7dfd611e1325586d9a75e4e9a33
6
+ metadata.gz: 479fb301112e0a7389977904e53ecd721048eed0d3b12757b34c93afd253fe3df9d2016e9ef7d77d06132bf2e3966bcdf58808318b02d04f6f22d6b7e63789d1
7
+ data.tar.gz: 7ed63ff4cea1db8f534fdd4ac1c3386a1660dd614d00764461850574cef0d19372447b25ab2e342745ce3ece7fe73743609ee5d03b074092f9b24d02326af32a
@@ -2,7 +2,6 @@
2
2
  # - gem install bundler
3
3
 
4
4
  rvm:
5
- - 1.9.3
6
5
  - 2.0.0
7
6
  - 2.1.0
8
7
  - 2.1.5
@@ -1,6 +1,10 @@
1
1
  # Change Log
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ ## 2.0.0 - March 2020
5
+ - BREAKING: Dropped support for ruby 1.9.3
6
+ - Add support for `details` and `summary` tags, see #85
7
+
4
8
  ## 1.4.0 – January 2020
5
9
  - BREAKING: jump links will no longer be ignored but treated as links, see #82
6
10
 
data/README.md CHANGED
@@ -11,7 +11,7 @@ See [Change Log](CHANGELOG.md)
11
11
  ## Requirements
12
12
 
13
13
  1. [Nokogiri](http://nokogiri.org/)
14
- 2. Ruby 1.9.3 or higher
14
+ 2. Ruby 2.0.0 or higher
15
15
 
16
16
  ## Installation
17
17
 
@@ -13,6 +13,7 @@ require 'reverse_markdown/converters/code'
13
13
  require 'reverse_markdown/converters/del'
14
14
  require 'reverse_markdown/converters/div'
15
15
  require 'reverse_markdown/converters/drop'
16
+ require 'reverse_markdown/converters/details'
16
17
  require 'reverse_markdown/converters/em'
17
18
  require 'reverse_markdown/converters/h'
18
19
  require 'reverse_markdown/converters/hr'
@@ -0,0 +1,25 @@
1
+ module ReverseMarkdown
2
+ module Converters
3
+ class Details < Base
4
+ def convert(node, state = {})
5
+ content = treat_children(node, state.merge(already_processed: true))
6
+ if disabled? || content.strip.empty? || state[:already_processed]
7
+ content
8
+ else
9
+ "##{content}"
10
+ end
11
+ end
12
+
13
+ def enabled?
14
+ ReverseMarkdown.config.github_flavored
15
+ end
16
+
17
+ def disabled?
18
+ !enabled?
19
+ end
20
+ end
21
+
22
+ register :details, Details.new
23
+ register :summary, Details.new
24
+ end
25
+ end
@@ -1,3 +1,3 @@
1
1
  module ReverseMarkdown
2
- VERSION = '1.4.0'
2
+ VERSION = '2.0.0'
3
3
  end
@@ -0,0 +1,23 @@
1
+ require 'spec_helper'
2
+
3
+ describe ReverseMarkdown::Converters::Details do
4
+ let(:converter) { ReverseMarkdown::Converters::Details.new }
5
+
6
+ context 'for standard markdown' do
7
+ before { ReverseMarkdown.config.github_flavored = false }
8
+
9
+ it 'handles details tags correctly' do
10
+ node = node_for("<details>foo</details>")
11
+ expect(converter.convert(node)).to include "foo"
12
+ end
13
+ end
14
+
15
+ context 'for github_flavored markdown' do
16
+ before { ReverseMarkdown.config.github_flavored = true }
17
+
18
+ it 'handles details tags correctly' do
19
+ node = node_for("<details>foo</details>")
20
+ expect(converter.convert(node)).to include "#foo"
21
+ end
22
+ end
23
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reverse_markdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johannes Opper
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-07 00:00:00.000000000 Z
11
+ date: 2020-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -123,6 +123,7 @@ files:
123
123
  - lib/reverse_markdown/converters/bypass.rb
124
124
  - lib/reverse_markdown/converters/code.rb
125
125
  - lib/reverse_markdown/converters/del.rb
126
+ - lib/reverse_markdown/converters/details.rb
126
127
  - lib/reverse_markdown/converters/div.rb
127
128
  - lib/reverse_markdown/converters/drop.rb
128
129
  - lib/reverse_markdown/converters/em.rb
@@ -173,6 +174,7 @@ files:
173
174
  - spec/lib/reverse_markdown/converters/blockquote_spec.rb
174
175
  - spec/lib/reverse_markdown/converters/br_spec.rb
175
176
  - spec/lib/reverse_markdown/converters/del_spec.rb
177
+ - spec/lib/reverse_markdown/converters/details_spec.rb
176
178
  - spec/lib/reverse_markdown/converters/li_spec.rb
177
179
  - spec/lib/reverse_markdown/converters/pre_spec.rb
178
180
  - spec/lib/reverse_markdown/converters/strong_spec.rb
@@ -199,7 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
199
201
  - !ruby/object:Gem::Version
200
202
  version: '0'
201
203
  requirements: []
202
- rubygems_version: 3.0.3
204
+ rubygems_version: 3.1.2
203
205
  signing_key:
204
206
  specification_version: 4
205
207
  summary: Convert html code into markdown.
@@ -234,6 +236,7 @@ test_files:
234
236
  - spec/lib/reverse_markdown/converters/blockquote_spec.rb
235
237
  - spec/lib/reverse_markdown/converters/br_spec.rb
236
238
  - spec/lib/reverse_markdown/converters/del_spec.rb
239
+ - spec/lib/reverse_markdown/converters/details_spec.rb
237
240
  - spec/lib/reverse_markdown/converters/li_spec.rb
238
241
  - spec/lib/reverse_markdown/converters/pre_spec.rb
239
242
  - spec/lib/reverse_markdown/converters/strong_spec.rb