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.

@@ -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
- while (i < size && (data[i] == '-' || data[i] == '.'
265
- || data[i] == '_' || data[i] == '@'
266
- || (data[i] >= 'a' && data[i] <= 'z')
267
- || (data[i] >= 'A' && data[i] <= 'Z')
268
- || (data[i] >= '0' && data[i] <= '9'))) {
269
- if (data[i] == '@') nb += 1;
270
- i += 1; }
271
- if (i >= size || data[i] != '>' || nb != 1) return 0;
272
- return i + 1;
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
- if ((data[i] < 'a' || data[i] > 'z')
288
- && (data[i] < 'A' || data[i] > 'Z')) return 0;
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 && (isalpha(data[i]) || data[i] == '.' || data[i] == '+' || data[i] == '-'))
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] == '@') {
@@ -21,9 +21,9 @@
21
21
 
22
22
  #include "buffer.h"
23
23
 
24
- #define UPSKIRT_VERSION "1.2.0"
24
+ #define UPSKIRT_VERSION "1.14.0"
25
25
  #define UPSKIRT_VER_MAJOR 1
26
- #define UPSKIRT_VER_MINOR 2
26
+ #define UPSKIRT_VER_MINOR 14
27
27
  #define UPSKIRT_VER_REVISION 0
28
28
 
29
29
  /********************
@@ -26,7 +26,7 @@
26
26
  # end
27
27
  #
28
28
  class Redcarpet
29
- VERSION = '1.13.2'
29
+ VERSION = '1.14.0'
30
30
 
31
31
  # Original Markdown formatted text.
32
32
  attr_reader :text
@@ -1,9 +1,9 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'redcarpet'
3
- s.version = '1.13.2'
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-16'
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: 39
4
+ hash: 47
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
- - 13
9
- - 2
10
- version: 1.13.2
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-16 00:00:00 +03:00
19
+ date: 2011-05-17 00:00:00 +03:00
20
20
  default_executable:
21
21
  dependencies: []
22
22