github-markdown 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1189,7 +1189,8 @@ prefix_codefence(uint8_t *data, size_t size)
1189
1189
  static size_t
1190
1190
  is_codefence(uint8_t *data, size_t size, struct buf *syntax)
1191
1191
  {
1192
- size_t i = 0, syn = 0;
1192
+ size_t i = 0, syn_len = 0;
1193
+ uint8_t *syn_start;
1193
1194
 
1194
1195
  i = prefix_codefence(data, size);
1195
1196
  if (i == 0)
@@ -1198,14 +1199,13 @@ is_codefence(uint8_t *data, size_t size, struct buf *syntax)
1198
1199
  while (i < size && data[i] == ' ')
1199
1200
  i++;
1200
1201
 
1201
- if (syntax)
1202
- syntax->data = data + i;
1202
+ syn_start = data + i;
1203
1203
 
1204
1204
  if (i < size && data[i] == '{') {
1205
- i++; syntax->data++;
1205
+ i++; syn_start++;
1206
1206
 
1207
1207
  while (i < size && data[i] != '}' && data[i] != '\n') {
1208
- syn++; i++;
1208
+ syn_len++; i++;
1209
1209
  }
1210
1210
 
1211
1211
  if (i == size || data[i] != '}')
@@ -1213,22 +1213,24 @@ is_codefence(uint8_t *data, size_t size, struct buf *syntax)
1213
1213
 
1214
1214
  /* strip all whitespace at the beginning and the end
1215
1215
  * of the {} block */
1216
- while (syn > 0 && _isspace(syntax->data[0])) {
1217
- syntax->data++; syn--;
1216
+ while (syn_len > 0 && _isspace(syn_start[0])) {
1217
+ syn_start++; syn_len--;
1218
1218
  }
1219
1219
 
1220
- while (syn > 0 && _isspace(syntax->data[syn - 1]))
1221
- syn--;
1220
+ while (syn_len > 0 && _isspace(syn_start[syn_len - 1]))
1221
+ syn_len--;
1222
1222
 
1223
1223
  i++;
1224
1224
  } else {
1225
1225
  while (i < size && !_isspace(data[i])) {
1226
- syn++; i++;
1226
+ syn_len++; i++;
1227
1227
  }
1228
1228
  }
1229
1229
 
1230
- if (syntax)
1231
- syntax->size = syn;
1230
+ if (syntax) {
1231
+ syntax->data = syn_start;
1232
+ syntax->size = syn_len;
1233
+ }
1232
1234
 
1233
1235
  while (i < size && data[i] != '\n') {
1234
1236
  if (!_isspace(data[i]))
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  Gem::Specification.new do |s|
3
3
  s.name = 'github-markdown'
4
- s.version = '0.3.1'
4
+ s.version = '0.3.2'
5
5
  s.summary = 'The Markdown parser for GitHub.com'
6
6
  s.description = 'Self-contained Markdown parser for GitHub, with all our custom extensions'
7
7
  s.date = '2012-04-04'
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github-markdown
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 1
10
- version: 0.3.1
9
+ - 2
10
+ version: 0.3.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - GitHub, Inc
@@ -15,7 +15,8 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-04-04 00:00:00 Z
18
+ date: 2012-04-04 00:00:00 -07:00
19
+ default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
22
  name: rake-compiler
@@ -61,6 +62,7 @@ files:
61
62
  - github-markdown.gemspec
62
63
  - lib/github/markdown.rb
63
64
  - test/gfm_test.rb
65
+ has_rdoc: true
64
66
  homepage: http://github.github.com/github-flavored-markdown/
65
67
  licenses: []
66
68
 
@@ -90,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
92
  requirements: []
91
93
 
92
94
  rubyforge_project:
93
- rubygems_version: 1.8.15
95
+ rubygems_version: 1.6.2
94
96
  signing_key:
95
97
  specification_version: 3
96
98
  summary: The Markdown parser for GitHub.com