reverse_markdown 1.0.0 → 1.0.1

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: 950a3b8b3c2243b54c3d30a202e97c8084245a7e
4
- data.tar.gz: 4c1c739b0e2b0aa7979e37d229697ac34eb98319
3
+ metadata.gz: c57772b3497c7c256052c61ccd42a3c003671429
4
+ data.tar.gz: 2e90d7b68ce83784464dab7b3500b4a3fb5e22a8
5
5
  SHA512:
6
- metadata.gz: bc484226804f23f87509417538b7cdfa3b74a862f02ab4a7846f8cec9ab0c33f808b7d4ae206ce02710f7a81f861e8c00e2acc141ff73c974a4d8fbbf6fa5be2
7
- data.tar.gz: 5facbab6c8082d32ac0928d56d940f0153a7e0fae26b90f55aa1c0ae4ee0d35f789f436015a33ed6360e496ebf2b125676ce874b850e2dfefeadf8c571f8ffc4
6
+ metadata.gz: 6ece1678de088490e0e1442f9deeee55cc5346c2e8573643fdc628f298efe689ce145f0b87a04d1ed927784bcf452e3ecfc3751c861e747d1d96d76fcfec4d4d
7
+ data.tar.gz: 963b8984561fdea0eb8f7757ce1a727fdc6c0e7a7964a012e15844ca210988714232af08568c25d838d382de6a348f9b119187bfdcbb3a230110fbbb41bb1472
data/.travis.yml CHANGED
@@ -1,9 +1,14 @@
1
+ before_install:
2
+ - gem install bundler
3
+
1
4
  rvm:
2
5
  - 1.9.3
3
6
  - 2.0.0
4
7
  - 2.1.0
5
8
  - 2.1.5
6
9
  - 2.2.0
10
+ - 2.2.4
11
+ - 2.3.0
7
12
 
8
13
  script: "bundle exec rake spec"
9
14
 
data/CHANGELOG.md CHANGED
@@ -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.0.1 - Jan 2016
5
+ ### Changes
6
+ - Prevent double escaping of * and _, thanks @craig-day (#61)
7
+
4
8
  ## 1.0.0 - Nov 2015
5
9
  ### Changes
6
10
  - BREAKING: Parsing was significantly improved, thanks @craig-day (#60)
@@ -12,7 +12,7 @@ module ReverseMarkdown
12
12
  end
13
13
 
14
14
  def escape_keychars(string)
15
- string.gsub(/[\*\_]/, '*' => '\*', '_' => '\_')
15
+ string.gsub(/(?<!\\)[*_]/, '*' => '\*', '_' => '\_')
16
16
  end
17
17
 
18
18
  def extract_title(node)
@@ -31,14 +31,14 @@ module ReverseMarkdown
31
31
 
32
32
  text = preserve_keychars_within_backticks(text)
33
33
  text = preserve_tags(text)
34
-
34
+
35
35
  text
36
36
  end
37
37
 
38
38
  def preserve_nbsp(text)
39
39
  text.gsub(/\u00A0/, "&nbsp;")
40
40
  end
41
-
41
+
42
42
  def preserve_tags(text)
43
43
  text.gsub(/[<>]/, '>' => '\>', '<' => '\<')
44
44
  end
@@ -1,3 +1,3 @@
1
1
  module ReverseMarkdown
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
3
  end
@@ -17,3 +17,7 @@
17
17
  </strong>
18
18
  </strong>
19
19
  </p>
20
+
21
+ <a href="example.com/foo_bar">
22
+ <img src="example.com/foo_bar.png"> I\_AM\_HELPFUL
23
+ </a>
@@ -7,7 +7,11 @@ describe ReverseMarkdown do
7
7
  subject { ReverseMarkdown.convert(input) }
8
8
 
9
9
  it "should make sense of strong-crazy markup (as seen in the wild)" do
10
- expect(subject).to eq "**. \n \\*\\*\\* intentcast** : logo design \n **.**\n\n"
10
+ expect(subject).to include "**. \n \\*\\*\\* intentcast** : logo design \n **.**\n\n"
11
+ end
12
+
13
+ it "should not over escape * or _" do
14
+ expect(subject).to include '[![](example.com/foo_bar.png) I\_AM\_HELPFUL](example.com/foo_bar)'
11
15
  end
12
16
 
13
17
  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.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johannes Opper
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-13 00:00:00.000000000 Z
11
+ date: 2016-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -199,7 +199,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
199
199
  version: '0'
200
200
  requirements: []
201
201
  rubyforge_project: reverse_markdown
202
- rubygems_version: 2.4.8
202
+ rubygems_version: 2.5.1
203
203
  signing_key:
204
204
  specification_version: 4
205
205
  summary: Convert html code into markdown.