redcarpet 1.13.2 → 1.14.0
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/redcarpet/markdown.c +27 -13
- data/ext/redcarpet/markdown.h +2 -2
- data/lib/redcarpet.rb +1 -1
- data/redcarpet.gemspec +2 -2
- metadata +5 -5
data/ext/redcarpet/markdown.c
CHANGED
@@ -261,15 +261,28 @@ is_mail_autolink(char *data, size_t size)
|
|
261
261
|
size_t i = 0, nb = 0;
|
262
262
|
|
263
263
|
/* address is assumed to be: [-@._a-zA-Z0-9]+ with exactly one '@' */
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
264
|
+
for (i = 0; i < size; ++i) {
|
265
|
+
if (isalnum(data[i]))
|
266
|
+
continue;
|
267
|
+
|
268
|
+
switch (data[i]) {
|
269
|
+
case '@':
|
270
|
+
nb++;
|
271
|
+
|
272
|
+
case '-':
|
273
|
+
case '.':
|
274
|
+
case '_':
|
275
|
+
break;
|
276
|
+
|
277
|
+
case '>':
|
278
|
+
return (nb == 1) ? i + 1 : 0;
|
279
|
+
|
280
|
+
default:
|
281
|
+
return 0;
|
282
|
+
}
|
283
|
+
}
|
284
|
+
|
285
|
+
return 0;
|
273
286
|
}
|
274
287
|
|
275
288
|
/* tag_length • returns the length of the given tag, or 0 is it's not valid */
|
@@ -281,17 +294,18 @@ tag_length(char *data, size_t size, enum mkd_autolink *autolink)
|
|
281
294
|
/* a valid tag can't be shorter than 3 chars */
|
282
295
|
if (size < 3) return 0;
|
283
296
|
|
284
|
-
/* begins with a '<' optionally followed by '/', followed by letter */
|
297
|
+
/* begins with a '<' optionally followed by '/', followed by letter or number */
|
285
298
|
if (data[0] != '<') return 0;
|
286
299
|
i = (data[1] == '/') ? 2 : 1;
|
287
|
-
|
288
|
-
|
300
|
+
|
301
|
+
if (!isalnum(data[i]))
|
302
|
+
return 0;
|
289
303
|
|
290
304
|
/* scheme test */
|
291
305
|
*autolink = MKDA_NOT_AUTOLINK;
|
292
306
|
|
293
307
|
/* try to find the beggining of an URI */
|
294
|
-
while (i < size && (
|
308
|
+
while (i < size && (isalnum(data[i]) || data[i] == '.' || data[i] == '+' || data[i] == '-'))
|
295
309
|
i++;
|
296
310
|
|
297
311
|
if (i > 1 && data[i] == '@') {
|
data/ext/redcarpet/markdown.h
CHANGED
@@ -21,9 +21,9 @@
|
|
21
21
|
|
22
22
|
#include "buffer.h"
|
23
23
|
|
24
|
-
#define UPSKIRT_VERSION "1.
|
24
|
+
#define UPSKIRT_VERSION "1.14.0"
|
25
25
|
#define UPSKIRT_VER_MAJOR 1
|
26
|
-
#define UPSKIRT_VER_MINOR
|
26
|
+
#define UPSKIRT_VER_MINOR 14
|
27
27
|
#define UPSKIRT_VER_REVISION 0
|
28
28
|
|
29
29
|
/********************
|
data/lib/redcarpet.rb
CHANGED
data/redcarpet.gemspec
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'redcarpet'
|
3
|
-
s.version = '1.
|
3
|
+
s.version = '1.14.0'
|
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-05-
|
6
|
+
s.date = '2011-05-17'
|
7
7
|
s.email = 'vicent@github.com'
|
8
8
|
s.homepage = 'http://github.com/tanoku/redcarpet'
|
9
9
|
s.authors = ["Natacha Porté", "Vicent Martí"]
|
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: 47
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 1.
|
8
|
+
- 14
|
9
|
+
- 0
|
10
|
+
version: 1.14.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-05-
|
19
|
+
date: 2011-05-17 00:00:00 +03:00
|
20
20
|
default_executable:
|
21
21
|
dependencies: []
|
22
22
|
|