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 +4 -4
- data/ext/markdown/autolink.c +11 -7
- data/github-markdown.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ead7b9ae4db02386f4f35576e957f92eb26bfbd
|
4
|
+
data.tar.gz: c972c6d581bf37be2359c046274200b40f4ddb18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 509eb216bdd44d8dc4dad574dee402642953dce1ab43279a137f6e78f516343c00983d46cbb6b20cff4b852e5c9c90243c9bfbb22b81f99905ec6f1d7cb740dc
|
7
|
+
data.tar.gz: 06873a9f7da78b90d5be14ddfcfda5331e22600b7bd4ff8bb2a467eef89ec429758f6acde3b6c639cf2b1f7e684d964f80131ddd20f788574bbeeef2c21ca261
|
data/ext/markdown/autolink.c
CHANGED
@@ -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
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
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 &&
|
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)
|
data/github-markdown.gemspec
CHANGED
@@ -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.
|
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'
|