reverse_markdown 1.0.5 → 1.1.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
  SHA1:
3
- metadata.gz: 11ce7d306707ed1f0e5a3ac81ad987aacb324923
4
- data.tar.gz: 4b922a19fc5f0074ec8b2025fdb9cd731215b469
3
+ metadata.gz: e62d51d33119ebe3919029cf32b1e642af179b43
4
+ data.tar.gz: aaab49c9d182d104a60b9a8fb42e11cb499fc29d
5
5
  SHA512:
6
- metadata.gz: 3081f4ae63f7b19a6564fe67f84fcfa1294e0d6cc3b3f336bbc2a913d59d0acaf155e7261610b8dca3bb00cbbb6aaec27fda964deb23b3122941fd6010b45eda
7
- data.tar.gz: 40ada4d795985e420fec12c9f5ce164897e87717276b66f155a163eeae679f7619d3f1e35512cf8753472b7a188d893ea044e744d305722773ed2b8fc311acf7
6
+ metadata.gz: 6b8c45f72cd959a8115c2f4b188e98edf93383958439981e989381d86620ff7d301ac0d3102ea95bc5522b60e957236c7d3d3b4d24fb0e40e7fe5d571f7c9a1b
7
+ data.tar.gz: 648a73ecc734e66f4168445bef75b88cb8d9348c6a90304f3e99622df0be0b1553928f511f40ce4765f495e0ad8c589bf61fd8d0e17a8d73c872b9f3904fc9d1
@@ -12,6 +12,7 @@ rvm:
12
12
  - 2.3.0
13
13
  - 2.3.1
14
14
  - 2.4.2
15
+ - jruby-9.1.16.0
15
16
 
16
17
  script: "bundle exec rake spec"
17
18
 
@@ -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
+ ## 1.1.0 - April 2018
5
+ - Support Jruby, thanks @grddev (#71)
6
+ - Bypass `<tfoot>` tags, thanks @mu-is-too-short (#70)
7
+
4
8
  ## 1.0.5 - February 2018
5
9
  - Fix newline handling within pre tags, thanks @niallcolfer (#69)
6
10
 
@@ -12,5 +12,6 @@ module ReverseMarkdown
12
12
  register :span, Bypass.new
13
13
  register :thead, Bypass.new
14
14
  register :tbody, Bypass.new
15
+ register :tfoot, Bypass.new
15
16
  end
16
17
  end
@@ -8,5 +8,6 @@ module ReverseMarkdown
8
8
 
9
9
  register :colgroup, Ignore.new
10
10
  register :col, Ignore.new
11
+ register :head, Ignore.new
11
12
  end
12
13
  end
@@ -1,3 +1,3 @@
1
1
  module ReverseMarkdown
2
- VERSION = '1.0.5'
2
+ VERSION = '1.1.0'
3
3
  end
@@ -23,7 +23,7 @@ Gem::Specification.new do |s|
23
23
  s.add_development_dependency 'rspec'
24
24
  s.add_development_dependency 'simplecov'
25
25
  s.add_development_dependency 'rake'
26
- s.add_development_dependency 'redcarpet'
26
+ s.add_development_dependency 'kramdown'
27
27
  # s.add_development_dependency 'byebug'
28
28
  s.add_development_dependency 'codeclimate-test-reporter'
29
29
  end
@@ -26,6 +26,13 @@
26
26
  <td>data 3-2</td>
27
27
  </tr>
28
28
  </tbody>
29
+ <tfoot>
30
+ <tr>
31
+ <td>footer 1</td>
32
+ <td>footer 2</td>
33
+ <td>footer 3</td>
34
+ </tr>
35
+ </tfoot>
29
36
  </table>
30
37
 
31
38
  <table>
@@ -9,6 +9,7 @@ describe ReverseMarkdown do
9
9
  it { is_expected.to match /\n\| header 1 \| header 2 \| header 3 \|\n\| --- \| --- \| --- \|\n/ }
10
10
  it { is_expected.to match /\n\| data 1-1 \| data 2-1 \| data 3-1 \|\n/ }
11
11
  it { is_expected.to match /\n\| data 1-2 \| data 2-2 \| data 3-2 \|\n/ }
12
+ it { is_expected.to match /\n\| footer 1 \| footer 2 \| footer 3 \|\n/ }
12
13
 
13
14
  it { is_expected.to match /\n\| _header oblique_ \| \*\*header bold\*\* \| `header code` \|\n| --- \| --- \| --- \|\n/ }
14
15
  it { is_expected.to match /\n\| _data oblique_ \| \*\*data bold\*\* \| `data code` \|\n/ }
@@ -1,6 +1,6 @@
1
1
  # coding:utf-8
2
2
 
3
- require 'redcarpet'
3
+ require 'kramdown'
4
4
  require 'spec_helper'
5
5
 
6
6
  describe 'Round trip: HTML to markdown (via reverse_markdown) to HTML (via redcarpet)' do
@@ -9,12 +9,12 @@ describe 'Round trip: HTML to markdown (via reverse_markdown) to HTML (via redca
9
9
 
10
10
  def roundtrip_should_preserve(input)
11
11
  output = html2markdown2html input
12
- expect(normalize_html(input)).to eq normalize_html(output)
12
+ expect(normalize_html(output)).to eq normalize_html(input)
13
13
  end
14
14
 
15
15
  def html2markdown2html(orig_html)
16
16
  markdown = ReverseMarkdown.convert orig_html
17
- new_html = Redcarpet::Markdown.new(Redcarpet::Render::HTML).render(markdown)
17
+ new_html = Kramdown::Document.new(markdown).to_html
18
18
  new_html
19
19
  end
20
20
 
@@ -53,7 +53,7 @@ describe 'Round trip: HTML to markdown (via reverse_markdown) to HTML (via redca
53
53
  end
54
54
 
55
55
  it "should preserve <hr> tags" do
56
- roundtrip_should_preserve("<hr>")
56
+ roundtrip_should_preserve("<hr />")
57
57
  end
58
58
 
59
59
  it "should preserve <em> tags" do
@@ -69,7 +69,7 @@ describe 'Round trip: HTML to markdown (via reverse_markdown) to HTML (via redca
69
69
  end
70
70
 
71
71
  it "should preserve <br> tags" do
72
- roundtrip_should_preserve("<p>yes!<br>\n we can!</p>")
72
+ roundtrip_should_preserve("<p>yes!<br />\n we can!</p>")
73
73
  end
74
74
 
75
75
  it "should preserve <a> tags" do
@@ -78,8 +78,8 @@ describe 'Round trip: HTML to markdown (via reverse_markdown) to HTML (via redca
78
78
  end
79
79
 
80
80
  it "should preserve <img> tags" do
81
- roundtrip_should_preserve(%{<p><img src="http://foo.bar/dog.png" alt="My Dog" title="Ralph"></p>})
82
- roundtrip_should_preserve(%{<p><img src="http://foo.bar/dog.png" alt="My Dog"></p>})
81
+ roundtrip_should_preserve(%{<p><img src="http://foo.bar/dog.png" alt="My Dog" title="Ralph" /></p>})
82
+ roundtrip_should_preserve(%{<p><img src="http://foo.bar/dog.png" alt="My Dog" /></p>})
83
83
  end
84
84
 
85
85
  it "should preserve code blocks" do
@@ -17,5 +17,5 @@ RSpec.configure do |config|
17
17
  end
18
18
 
19
19
  def node_for(html)
20
- Nokogiri::HTML.parse(html).root.child.child
20
+ Nokogiri::HTML.parse(html).root.children.last.child
21
21
  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.0.5
4
+ version: 1.1.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: 2018-02-03 00:00:00.000000000 Z
11
+ date: 2018-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -67,7 +67,7 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: redcarpet
70
+ name: kramdown
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="