github-markdown 0.6.5 → 0.6.6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 28fa8ed9daf6133d7ec96ffe630eced45affce35
4
- data.tar.gz: 58e12eaab9d955409da483d909de7d9b7a875560
3
+ metadata.gz: 2ead7b9ae4db02386f4f35576e957f92eb26bfbd
4
+ data.tar.gz: c972c6d581bf37be2359c046274200b40f4ddb18
5
5
  SHA512:
6
- metadata.gz: 7d4aae8a213ec9c0a54d99a8e9e6e200e367876b3a911715adcab3b99b1cb927b722e2318064243cb597d190d7a2750a55f11f068b53f3876c29f51581f56de9
7
- data.tar.gz: 8c40378c643ec6548bc4efabc358db9d0ba4d0f50c5dec32d2614d86358df123f04be19cedf4fa8ca4bf797fb379997170eae4eacd5bda403f9c1cba17e13941
6
+ metadata.gz: 509eb216bdd44d8dc4dad574dee402642953dce1ab43279a137f6e78f516343c00983d46cbb6b20cff4b852e5c9c90243c9bfbb22b81f99905ec6f1d7cb740dc
7
+ data.tar.gz: 06873a9f7da78b90d5be14ddfcfda5331e22600b7bd4ff8bb2a467eef89ec429758f6acde3b6c639cf2b1f7e684d964f80131ddd20f788574bbeeef2c21ca261
@@ -135,16 +135,20 @@ autolink_delim(uint8_t *data, size_t link_end, size_t max_rewind, size_t size)
135
135
  static size_t
136
136
  check_domain(uint8_t *data, size_t size, int allow_short)
137
137
  {
138
- size_t i, np = 0;
138
+ size_t i, np = 0, uscore1 = 0, uscore2 = 0;
139
139
 
140
- if (!isalnum(data[0]))
141
- return 0;
142
-
143
- for (i = 1; i < size - 1; ++i) {
144
- if (data[i] == '.') np++;
140
+ for (i = 1; i < size - 1; i++) {
141
+ if (data[i] == '_') uscore2++;
142
+ else if (data[i] == '.') {
143
+ uscore1 = uscore2;
144
+ uscore2 = 0;
145
+ np++;
146
+ }
145
147
  else if (!isalnum(data[i]) && data[i] != '-') break;
146
148
  }
147
149
 
150
+ if (uscore1 > 0 || uscore2 > 0) return 0;
151
+
148
152
  if (allow_short) {
149
153
  /* We don't need a valid domain in the strict sense (with
150
154
  * least one dot; so just make sure it's composed of valid
@@ -169,7 +173,7 @@ sd_autolink__www(
169
173
  {
170
174
  size_t link_end;
171
175
 
172
- if (max_rewind > 0 && !ispunct(data[-1]) && !isspace(data[-1]))
176
+ if (max_rewind > 0 && data[-1] != '(' && data[-1] != '[' && !isspace(data[-1]))
173
177
  return 0;
174
178
 
175
179
  if (size < 4 || memcmp(data, "www.", strlen("www.")) != 0)
@@ -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.6.5'
4
+ s.version = '0.6.6'
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 = '2013-10-01'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github-markdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.5
4
+ version: 0.6.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub, Inc