redcarpet 1.3.3 → 1.5.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.
Potentially problematic release.
This version of redcarpet might be problematic. Click here for more details.
- data/ext/markdown.c +304 -32
- data/ext/markdown.h +35 -37
- data/ext/redcarpet.c +31 -18
- data/ext/xhtml.c +148 -75
- data/ext/xhtml.h +13 -13
- data/lib/redcarpet.rb +10 -1
- data/redcarpet.gemspec +2 -2
- data/test/redcarpet_test.rb +27 -0
- metadata +5 -5
data/ext/xhtml.h
CHANGED
@@ -16,25 +16,25 @@
|
|
16
16
|
|
17
17
|
#ifndef UPSKIRT_XHTML_H
|
18
18
|
#define UPSKIRT_XHTML_H
|
19
|
+
|
19
20
|
typedef enum {
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
21
|
+
XHTML_SKIP_HTML = (1 << 0),
|
22
|
+
XHTML_SKIP_STYLE = (1 << 1),
|
23
|
+
XHTML_SKIP_IMAGES = (1 << 2),
|
24
|
+
XHTML_SKIP_LINKS = (1 << 3),
|
25
|
+
XHTML_SMARTYPANTS = (1 << 4),
|
26
|
+
XHTML_EXPAND_TABS = (1 << 5),
|
27
|
+
XHTML_AUTOLINK = (1 << 6),
|
28
|
+
XHTML_SAFELINK = (1 << 7),
|
29
|
+
XHTML_TOC = (1 << 8),
|
30
|
+
XHTML_SKIP_STRIKETHROUGH = (1 << 10),
|
29
31
|
} render_mode;
|
30
32
|
|
31
33
|
void
|
32
|
-
init_xhtml_renderer(struct mkd_renderer *renderer,
|
33
|
-
unsigned int render_flags,
|
34
|
-
unsigned int parser_flags, int recursion_depth);
|
34
|
+
init_xhtml_renderer(struct mkd_renderer *renderer, unsigned int render_flags);
|
35
35
|
|
36
36
|
void
|
37
|
-
init_toc_renderer(struct mkd_renderer *renderer
|
37
|
+
init_toc_renderer(struct mkd_renderer *renderer);
|
38
38
|
|
39
39
|
void
|
40
40
|
free_renderer(struct mkd_renderer *renderer);
|
data/lib/redcarpet.rb
CHANGED
@@ -26,7 +26,7 @@
|
|
26
26
|
# end
|
27
27
|
#
|
28
28
|
class Redcarpet
|
29
|
-
VERSION = '1.
|
29
|
+
VERSION = '1.5.0'
|
30
30
|
|
31
31
|
# Original Markdown formatted text.
|
32
32
|
attr_reader :text
|
@@ -60,6 +60,15 @@ class Redcarpet
|
|
60
60
|
# Add TOC anchors to every header
|
61
61
|
attr_accessor :generate_toc
|
62
62
|
|
63
|
+
# Do not process tables
|
64
|
+
attr_accessor :no_tables
|
65
|
+
|
66
|
+
# Do not process ~~strikethrough~~
|
67
|
+
attr_accessor :no_strikethrough
|
68
|
+
|
69
|
+
# Do not process fenced code blocks
|
70
|
+
attr_accessor :no_fencedcode
|
71
|
+
|
63
72
|
def initialize(text, *extensions)
|
64
73
|
@text = text
|
65
74
|
extensions.each { |e| send("#{e}=", true) }
|
data/redcarpet.gemspec
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'redcarpet'
|
3
|
-
s.version = '1.
|
3
|
+
s.version = '1.5.0'
|
4
4
|
s.summary = "Ruby bindings for libupskirt"
|
5
|
-
s.date = '2011-04-
|
5
|
+
s.date = '2011-04-11'
|
6
6
|
s.email = 'vicent@github.com'
|
7
7
|
s.homepage = 'http://github.com/tanoku/redcarpet'
|
8
8
|
s.has_rdoc = true
|
data/test/redcarpet_test.rb
CHANGED
@@ -154,4 +154,31 @@ class RedcarpetTest < Test::Unit::TestCase
|
|
154
154
|
######
|
155
155
|
header
|
156
156
|
end
|
157
|
+
|
158
|
+
def test_that_no_tables_flag_works
|
159
|
+
rd = Redcarpet.new(<<EOS, :no_tables)
|
160
|
+
aaa | bbbb
|
161
|
+
-----|------
|
162
|
+
hello|sailor
|
163
|
+
EOS
|
164
|
+
assert rd.to_html !~ /<table/
|
165
|
+
end
|
166
|
+
|
167
|
+
def test_strikethrough
|
168
|
+
rd = Redcarpet.new("this is ~some~ striked ~~text~~", :no_strikethrough)
|
169
|
+
assert rd.to_html !~ /text-decoration:line-through;/
|
170
|
+
end
|
171
|
+
|
172
|
+
def test_that_no_fenced_flag_works
|
173
|
+
rd = Redcarpet.new(<<fenced, :no_fencedcode)
|
174
|
+
This is a simple test
|
175
|
+
|
176
|
+
~~~~~
|
177
|
+
This is some awesome code
|
178
|
+
with tabs and shit
|
179
|
+
~~~
|
180
|
+
fenced
|
181
|
+
assert rd.to_html !~ /<code/
|
182
|
+
end
|
183
|
+
|
157
184
|
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: 3
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 1.
|
8
|
+
- 5
|
9
|
+
- 0
|
10
|
+
version: 1.5.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- "Natacha Port\xC3\xA9"
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-04-
|
19
|
+
date: 2011-04-11 00:00:00 -07:00
|
20
20
|
default_executable:
|
21
21
|
dependencies: []
|
22
22
|
|