redcarpet 1.11.3 → 1.11.4
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of redcarpet might be problematic. Click here for more details.
- data/ext/markdown.c +1 -1
- data/ext/markdown.h +1 -1
- data/ext/redcarpet.c +1 -1
- data/ext/xhtml.c +2 -34
- data/lib/redcarpet.rb +3 -2
- data/redcarpet.gemspec +2 -2
- metadata +4 -4
data/ext/markdown.c
CHANGED
@@ -415,7 +415,7 @@ parse_emph1(struct buf *ob, struct render *rndr, char *data, size_t size, char c
|
|
415
415
|
|
416
416
|
if (data[i] == c && !isspace(data[i - 1])) {
|
417
417
|
|
418
|
-
if (
|
418
|
+
if (rndr->ext_flags & MKDEXT_STRICT_EMPHASIS) {
|
419
419
|
if (!(i + 1 == size || isspace(data[i + 1]) || ispunct(data[i + 1])))
|
420
420
|
continue;
|
421
421
|
}
|
data/ext/markdown.h
CHANGED
data/ext/redcarpet.c
CHANGED
@@ -56,7 +56,7 @@ static void rb_redcarpet__get_flags(VALUE ruby_obj,
|
|
56
56
|
* Markdown extensions -- all disabled by default
|
57
57
|
*/
|
58
58
|
if (rb_funcall(ruby_obj, rb_intern("strict"), 0) == Qtrue)
|
59
|
-
extensions |=
|
59
|
+
extensions |= MKDEXT_STRICT_EMPHASIS;
|
60
60
|
|
61
61
|
if (rb_funcall(ruby_obj, rb_intern("tables"), 0) == Qtrue)
|
62
62
|
extensions |= MKDEXT_TABLES;
|
data/ext/xhtml.c
CHANGED
@@ -49,38 +49,6 @@ put_scaped_char(struct buf *ob, char c)
|
|
49
49
|
}
|
50
50
|
}
|
51
51
|
|
52
|
-
static void
|
53
|
-
uri_escape(struct buf *ob, const char *src, size_t size)
|
54
|
-
{
|
55
|
-
size_t i;
|
56
|
-
|
57
|
-
for (i = 0; i < size; ++i) {
|
58
|
-
char c = src[i];
|
59
|
-
|
60
|
-
if (c == '%' && i + 2 < size && isxdigit(src[i + 1]) && isxdigit(src[i + 2])) {
|
61
|
-
bufput(ob, src + i, 3);
|
62
|
-
i += 2;
|
63
|
-
continue;
|
64
|
-
}
|
65
|
-
|
66
|
-
switch (c) {
|
67
|
-
case ';': case '/':
|
68
|
-
case '?': case ':':
|
69
|
-
case '@': case '=':
|
70
|
-
case '#': case '&':
|
71
|
-
case '.': case '+':
|
72
|
-
case '-':
|
73
|
-
bufputc(ob, c);
|
74
|
-
continue;
|
75
|
-
}
|
76
|
-
|
77
|
-
if (!isalnum(c))
|
78
|
-
bufprintf(ob, "%%%02x", (int)c);
|
79
|
-
else
|
80
|
-
bufputc(ob, c);
|
81
|
-
}
|
82
|
-
}
|
83
|
-
|
84
52
|
/* attr_escape • copy the buffer entity-escaping '<', '>', '&' and '"' */
|
85
53
|
static void
|
86
54
|
attr_escape(struct buf *ob, const char *src, size_t size)
|
@@ -154,7 +122,7 @@ rndr_autolink(struct buf *ob, struct buf *link, enum mkd_autolink type, void *op
|
|
154
122
|
BUFPUTSL(ob, "<a href=\"");
|
155
123
|
if (type == MKDA_EMAIL)
|
156
124
|
BUFPUTSL(ob, "mailto:");
|
157
|
-
|
125
|
+
bufput(ob, link->data, link->size);
|
158
126
|
BUFPUTSL(ob, "\">");
|
159
127
|
|
160
128
|
/*
|
@@ -323,7 +291,7 @@ rndr_link(struct buf *ob, struct buf *link, struct buf *title, struct buf *conte
|
|
323
291
|
return 0;
|
324
292
|
|
325
293
|
BUFPUTSL(ob, "<a href=\"");
|
326
|
-
if (link && link->size)
|
294
|
+
if (link && link->size) bufput(ob, link->data, link->size);
|
327
295
|
if (title && title->size) {
|
328
296
|
BUFPUTSL(ob, "\" title=\"");
|
329
297
|
attr_escape(ob, title->data, title->size); }
|
data/lib/redcarpet.rb
CHANGED
@@ -26,7 +26,7 @@
|
|
26
26
|
# end
|
27
27
|
#
|
28
28
|
class Redcarpet
|
29
|
-
VERSION = '1.11.
|
29
|
+
VERSION = '1.11.4'
|
30
30
|
|
31
31
|
# Original Markdown formatted text.
|
32
32
|
attr_reader :text
|
@@ -49,7 +49,7 @@ class Redcarpet
|
|
49
49
|
# Treat newlines in paragraphs as real line breaks, GitHub style
|
50
50
|
attr_accessor :hard_wrap
|
51
51
|
|
52
|
-
# Disable
|
52
|
+
# Disable relaxed emphasis processing.
|
53
53
|
attr_accessor :strict
|
54
54
|
|
55
55
|
# Generate safer HTML for code blocks (no custom CSS classes)
|
@@ -97,6 +97,7 @@ class RedcarpetCompat < Redcarpet
|
|
97
97
|
super(text, *extensions)
|
98
98
|
self.tables = !self.no_tables
|
99
99
|
self.strikethrough = true
|
100
|
+
self.lax_htmlblock = true
|
100
101
|
end
|
101
102
|
end
|
102
103
|
|
data/redcarpet.gemspec
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'redcarpet'
|
3
|
-
s.version = '1.11.
|
3
|
+
s.version = '1.11.4'
|
4
4
|
s.summary = "Ruby bindings for libupskirt"
|
5
5
|
s.description = 'A fast and safe Markdown to (X)HTML parser'
|
6
|
-
s.date = '2011-04-
|
6
|
+
s.date = '2011-04-28'
|
7
7
|
s.email = 'vicent@github.com'
|
8
8
|
s.homepage = 'http://github.com/tanoku/redcarpet'
|
9
9
|
s.has_rdoc = true
|
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: 51
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 11
|
9
|
-
-
|
10
|
-
version: 1.11.
|
9
|
+
- 4
|
10
|
+
version: 1.11.4
|
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-28 00:00:00 +03:00
|
20
20
|
default_executable:
|
21
21
|
dependencies: []
|
22
22
|
|