redcarpet 1.5.1 → 1.5.2
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.
- data/lib/redcarpet.rb +12 -1
- data/redcarpet.gemspec +1 -1
- data/test/redcarpet_test.rb +12 -0
- metadata +3 -3
data/lib/redcarpet.rb
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
# end
|
|
27
27
|
#
|
|
28
28
|
class Redcarpet
|
|
29
|
-
VERSION = '1.5.
|
|
29
|
+
VERSION = '1.5.2'
|
|
30
30
|
|
|
31
31
|
# Original Markdown formatted text.
|
|
32
32
|
attr_reader :text
|
|
@@ -78,4 +78,15 @@ end
|
|
|
78
78
|
|
|
79
79
|
Markdown = Redcarpet unless defined? Markdown
|
|
80
80
|
|
|
81
|
+
# Compatibility class;
|
|
82
|
+
# Creates a instance of Redcarpet with all markdown
|
|
83
|
+
# extensions enabled, same behavior as in RDiscount
|
|
84
|
+
class RedcarpetCompat < Redcarpet
|
|
85
|
+
def initialize(text, *extensions)
|
|
86
|
+
super(text, *extensions)
|
|
87
|
+
tables = true
|
|
88
|
+
strikethrough = true
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
|
|
81
92
|
require 'redcarpet.so'
|
data/redcarpet.gemspec
CHANGED
data/test/redcarpet_test.rb
CHANGED
|
@@ -185,5 +185,17 @@ fenced
|
|
|
185
185
|
assert Redcarpet.new(text).to_html !~ /<code/
|
|
186
186
|
assert Redcarpet.new(text, :fenced_code).to_html ~ /<code/
|
|
187
187
|
end
|
|
188
|
+
|
|
189
|
+
def test_that_compat_is_working
|
|
190
|
+
rd = RedcarpetCompat.new(<<EOS)
|
|
191
|
+
aaa | bbbb
|
|
192
|
+
-----|------
|
|
193
|
+
hello|sailor
|
|
194
|
+
|
|
195
|
+
This is ~~striked through~~ test
|
|
196
|
+
EOS
|
|
197
|
+
assert rd.to_html ~ /<table/
|
|
198
|
+
assert rd.to_html ~ /text-decoration:line-through;/
|
|
199
|
+
end
|
|
188
200
|
|
|
189
201
|
end
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: redcarpet
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 7
|
|
5
5
|
prerelease: false
|
|
6
6
|
segments:
|
|
7
7
|
- 1
|
|
8
8
|
- 5
|
|
9
|
-
-
|
|
10
|
-
version: 1.5.
|
|
9
|
+
- 2
|
|
10
|
+
version: 1.5.2
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- "Natacha Port\xC3\xA9"
|