| line |
true |
false |
branch |
|
49
|
1684 |
22 |
if (g_byteclass_inited) return; |
|
50
|
5632 |
22 |
for (c = 0; c < 256; c++) { |
|
52
|
5610 |
22 |
if (c == ' ' || c == '\t' || c == '\n' || c == '\v' || |
|
|
5588 |
22 |
if (c == ' ' || c == '\t' || c == '\n' || c == '\v' || |
|
|
5566 |
22 |
if (c == ' ' || c == '\t' || c == '\n' || c == '\v' || |
|
|
5544 |
22 |
if (c == ' ' || c == '\t' || c == '\n' || c == '\v' || |
|
|
5522 |
22 |
if (c == ' ' || c == '\t' || c == '\n' || c == '\v' || |
|
53
|
22 |
5500 |
c == '\f' || c == '\r') |
|
55
|
4576 |
1056 |
if ((c >= '0' && c <= '9') || |
|
|
4356 |
220 |
if ((c >= '0' && c <= '9') || |
|
|
4202 |
1210 |
if ((c >= '0' && c <= '9') || |
|
56
|
3630 |
572 |
(c >= 'A' && c <= 'Z') || |
|
|
3498 |
1342 |
(c >= 'A' && c <= 'Z') || |
|
57
|
572 |
2926 |
(c >= 'a' && c <= 'z')) |
|
60
|
4906 |
726 |
if ((c >= 33 && c <= 47) || (c >= 58 && c <= 64) || |
|
|
4576 |
330 |
if ((c >= 33 && c <= 47) || (c >= 58 && c <= 64) || |
|
|
4356 |
946 |
if ((c >= 33 && c <= 47) || (c >= 58 && c <= 64) || |
|
|
4202 |
154 |
if ((c >= 33 && c <= 47) || (c >= 58 && c <= 64) || |
|
|
3630 |
1518 |
if ((c >= 33 && c <= 47) || (c >= 58 && c <= 64) || |
|
61
|
3498 |
132 |
(c >= 91 && c <= 96) || (c >= 123 && c <= 126)) |
|
|
2926 |
2090 |
(c >= 91 && c <= 96) || (c >= 123 && c <= 126)) |
|
|
88 |
2838 |
(c >= 91 && c <= 96) || (c >= 123 && c <= 126)) |
|
75
|
0 |
54 |
if (c < 0x80) { *adv = 1; return c; } |
|
76
|
48 |
6 |
if ((c & 0xE0) == 0xC0 && i + 1 < n && |
|
|
48 |
0 |
if ((c & 0xE0) == 0xC0 && i + 1 < n && |
|
77
|
48 |
0 |
((unsigned char)s[i+1] & 0xC0) == 0x80) { |
|
81
|
6 |
0 |
if ((c & 0xF0) == 0xE0 && i + 2 < n && |
|
|
6 |
0 |
if ((c & 0xF0) == 0xE0 && i + 2 < n && |
|
82
|
6 |
0 |
((unsigned char)s[i+1] & 0xC0) == 0x80 && |
|
83
|
6 |
0 |
((unsigned char)s[i+2] & 0xC0) == 0x80) { |
|
89
|
0 |
0 |
if ((c & 0xF8) == 0xF0 && i + 3 < n && |
|
|
0 |
0 |
if ((c & 0xF8) == 0xF0 && i + 3 < n && |
|
90
|
0 |
0 |
((unsigned char)s[i+1] & 0xC0) == 0x80 && |
|
91
|
0 |
0 |
((unsigned char)s[i+2] & 0xC0) == 0x80 && |
|
92
|
0 |
0 |
((unsigned char)s[i+3] & 0xC0) == 0x80) { |
|
111
|
57 |
0 |
while (i > 0 && back < 3 && |
|
|
57 |
0 |
while (i > 0 && back < 3 && |
|
112
|
30 |
27 |
((unsigned char)s[i] & 0xC0) == 0x80) { |
|
122
|
3036 |
0 |
if (cp == 0x09 || cp == 0x0A || cp == 0x0B || cp == 0x0C || cp == 0x0D || |
|
|
2181 |
855 |
if (cp == 0x09 || cp == 0x0A || cp == 0x0B || cp == 0x0C || cp == 0x0D || |
|
|
2181 |
0 |
if (cp == 0x09 || cp == 0x0A || cp == 0x0B || cp == 0x0C || cp == 0x0D || |
|
|
2181 |
0 |
if (cp == 0x09 || cp == 0x0A || cp == 0x0B || cp == 0x0C || cp == 0x0D || |
|
|
2181 |
0 |
if (cp == 0x09 || cp == 0x0A || cp == 0x0B || cp == 0x0C || cp == 0x0D || |
|
|
397 |
1784 |
if (cp == 0x09 || cp == 0x0A || cp == 0x0B || cp == 0x0C || cp == 0x0D || |
|
124
|
6 |
1778 |
if (cp == 0xA0) return 1; /* NBSP */ |
|
125
|
0 |
1778 |
if (cp == 0x1680) return 1; |
|
126
|
6 |
1772 |
if (cp >= 0x2000 && cp <= 0x200A) return 1; |
|
|
0 |
6 |
if (cp >= 0x2000 && cp <= 0x200A) return 1; |
|
127
|
1778 |
0 |
if (cp == 0x2028 || cp == 0x2029) return 1; |
|
|
0 |
1778 |
if (cp == 0x2028 || cp == 0x2029) return 1; |
|
128
|
1778 |
0 |
if (cp == 0x202F || cp == 0x205F) return 1; |
|
|
0 |
1778 |
if (cp == 0x202F || cp == 0x205F) return 1; |
|
129
|
0 |
1778 |
if (cp == 0x3000) return 1; |
|
143
|
2982 |
54 |
if (cp < 0x80) return g_byteclass[cp] & BC_PUNCT; |
|
145
|
48 |
6 |
if (cp >= 0xA1 && cp <= 0xBF) return 1; |
|
|
6 |
42 |
if (cp >= 0xA1 && cp <= 0xBF) return 1; |
|
146
|
48 |
0 |
if (cp == 0xD7 || cp == 0xF7) return 1; |
|
|
0 |
48 |
if (cp == 0xD7 || cp == 0xF7) return 1; |
|
148
|
6 |
42 |
if (cp >= 0x2000 && cp <= 0x206F) return 1; |
|
|
0 |
6 |
if (cp >= 0x2000 && cp <= 0x206F) return 1; |
|
150
|
6 |
42 |
if (cp >= 0x2070 && cp <= 0x209F) return 1; |
|
|
0 |
6 |
if (cp >= 0x2070 && cp <= 0x209F) return 1; |
|
152
|
6 |
42 |
if (cp >= 0x20A0 && cp <= 0x20CF) return 1; |
|
|
6 |
0 |
if (cp >= 0x20A0 && cp <= 0x20CF) return 1; |
|
154
|
0 |
42 |
if (cp >= 0x2100 && cp <= 0x214F) return 1; |
|
|
0 |
0 |
if (cp >= 0x2100 && cp <= 0x214F) return 1; |
|
156
|
0 |
42 |
if (cp >= 0x2190 && cp <= 0x27BF) return 1; |
|
|
0 |
0 |
if (cp >= 0x2190 && cp <= 0x27BF) return 1; |
|
158
|
0 |
42 |
if (cp >= 0x3000 && cp <= 0x303F) return 1; |
|
|
0 |
0 |
if (cp >= 0x3000 && cp <= 0x303F) return 1; |
|
160
|
0 |
42 |
if (cp >= 0xFF00 && cp <= 0xFF0F) return 1; |
|
|
0 |
0 |
if (cp >= 0xFF00 && cp <= 0xFF0F) return 1; |
|
161
|
0 |
42 |
if (cp >= 0xFF1A && cp <= 0xFF20) return 1; |
|
|
0 |
0 |
if (cp >= 0xFF1A && cp <= 0xFF20) return 1; |
|
162
|
0 |
42 |
if (cp >= 0xFF3B && cp <= 0xFF40) return 1; |
|
|
0 |
0 |
if (cp >= 0xFF3B && cp <= 0xFF40) return 1; |
|
163
|
0 |
42 |
if (cp >= 0xFF5B && cp <= 0xFF65) return 1; |
|
|
0 |
0 |
if (cp >= 0xFF5B && cp <= 0xFF65) return 1; |
|
233
|
4492 |
2100 |
if (z->tail) z->tail->next = x; |
|
241
|
0 |
0 |
if (parent->children_tail) parent->children_tail->next = x; |
|
250
|
0 |
3311 |
if (k == 0) return; |
|
251
|
2752 |
559 |
if (z->tail && z->tail->type == N_TEXT && |
|
|
736 |
2016 |
if (z->tail && z->tail->type == N_TEXT && |
|
252
|
579 |
157 |
z->tail->s + z->tail->n == p) { |
|
266
|
0 |
333 |
if (k == 0) return; |
|
302
|
405 |
1113 |
if (pos == 0) { |
|
306
|
1086 |
27 |
if (b < 0x80) { |
|
314
|
416 |
1102 |
if (after_pos >= n) { |
|
318
|
1075 |
27 |
if (a < 0x80) { |
|
331
|
926 |
592 |
left = !after_ws && (!after_punct || before_ws || before_punct); |
|
|
263 |
663 |
left = !after_ws && (!after_punct || before_ws || before_punct); |
|
|
152 |
111 |
left = !after_ws && (!after_punct || before_ws || before_punct); |
|
|
54 |
98 |
left = !after_ws && (!after_punct || before_ws || before_punct); |
|
332
|
852 |
666 |
right = !before_ws && (!before_punct || after_ws || after_punct); |
|
|
243 |
609 |
right = !before_ws && (!before_punct || after_ws || after_punct); |
|
|
147 |
96 |
right = !before_ws && (!before_punct || after_ws || after_punct); |
|
|
54 |
93 |
right = !before_ws && (!before_punct || after_ws || after_punct); |
|
334
|
533 |
985 |
if (ch == '_') { |
|
336
|
295 |
238 |
can_open = left && (!right || before_punct); |
|
|
84 |
211 |
can_open = left && (!right || before_punct); |
|
|
30 |
54 |
can_open = left && (!right || before_punct); |
|
337
|
280 |
253 |
can_close = right && (!left || after_punct); |
|
|
84 |
196 |
can_close = right && (!left || after_punct); |
|
|
30 |
54 |
can_close = right && (!left || after_punct); |
|
360
|
794 |
54 |
while (pos < n && s[pos] == '`') pos++; |
|
|
470 |
324 |
while (pos < n && s[pos] == '`') pos++; |
|
364
|
366 |
66 |
while (scan < n) { |
|
369
|
24 |
342 |
if (!p) return 0; |
|
372
|
590 |
204 |
while (be < n && s[be] == '`') be++; |
|
|
452 |
138 |
while (be < n && s[be] == '`') be++; |
|
373
|
288 |
54 |
if (be - bs == open_len) { |
|
383
|
362 |
12 |
for (i = cs; i < ce; i++) { |
|
384
|
296 |
66 |
if (s[i] != ' ' && s[i] != '\n') { has_nonspace = 1; break; } |
|
|
276 |
20 |
if (s[i] != ' ' && s[i] != '\n') { has_nonspace = 1; break; } |
|
386
|
276 |
12 |
if (has_nonspace && ce - cs >= 2 && |
|
|
232 |
44 |
if (has_nonspace && ce - cs >= 2 && |
|
387
|
190 |
42 |
(s[cs] == ' ' || s[cs] == '\n') && |
|
|
20 |
170 |
(s[cs] == ' ' || s[cs] == '\n') && |
|
388
|
26 |
36 |
(s[ce - 1] == ' ' || s[ce - 1] == '\n')) { |
|
|
20 |
6 |
(s[ce - 1] == ' ' || s[ce - 1] == '\n')) { |
|
392
|
1260 |
264 |
for (i = cs; i < ce; i++) { |
|
393
|
24 |
1236 |
if (s[i] == '\n') { needs_replace = 1; break; } |
|
396
|
24 |
264 |
if (needs_replace) { |
|
398
|
288 |
24 |
for (i = cs; i < ce; i++) |
|
399
|
258 |
30 |
d[i - cs] = (s[i] == '\n') ? ' ' : s[i]; |
|
422
|
0 |
112 |
if (pos + 1 >= n) return 0; |
|
424
|
53 |
59 |
if (s[q] == '#') { |
|
430
|
53 |
0 |
if (q < n && (s[q] == 'x' || s[q] == 'X')) { |
|
|
45 |
8 |
if (q < n && (s[q] == 'x' || s[q] == 'X')) { |
|
|
6 |
39 |
if (q < n && (s[q] == 'x' || s[q] == 'X')) { |
|
432
|
42 |
0 |
while (q < n && digits < 6 && isxdigit((unsigned char)s[q])) { |
|
|
42 |
0 |
while (q < n && digits < 6 && isxdigit((unsigned char)s[q])) { |
|
|
28 |
14 |
while (q < n && digits < 6 && isxdigit((unsigned char)s[q])) { |
|
434
|
16 |
12 |
cp = cp * 16 + (c <= '9' ? c - '0' : |
|
|
3 |
9 |
cp = cp * 16 + (c <= '9' ? c - '0' : |
|
439
|
123 |
0 |
while (q < n && digits < 7 && s[q] >= '0' && s[q] <= '9') { |
|
|
120 |
3 |
while (q < n && digits < 7 && s[q] >= '0' && s[q] <= '9') { |
|
|
120 |
0 |
while (q < n && digits < 7 && s[q] >= '0' && s[q] <= '9') { |
|
|
84 |
36 |
while (q < n && digits < 7 && s[q] >= '0' && s[q] <= '9') { |
|
444
|
44 |
9 |
if (!digits || q >= n || s[q] != ';') return 0; |
|
|
44 |
0 |
if (!digits || q >= n || s[q] != ';') return 0; |
|
|
3 |
41 |
if (!digits || q >= n || s[q] != ';') return 0; |
|
447
|
38 |
3 |
if (cp == 0 || cp > 0x10FFFF || (cp >= 0xD800 && cp <= 0xDFFF)) |
|
|
38 |
0 |
if (cp == 0 || cp > 0x10FFFF || (cp >= 0xD800 && cp <= 0xDFFF)) |
|
|
0 |
38 |
if (cp == 0 || cp > 0x10FFFF || (cp >= 0xD800 && cp <= 0xDFFF)) |
|
|
0 |
0 |
if (cp == 0 || cp > 0x10FFFF || (cp >= 0xD800 && cp <= 0xDFFF)) |
|
449
|
26 |
15 |
if (cp < 0x80) { |
|
451
|
6 |
9 |
} else if (cp < 0x800) { |
|
454
|
9 |
0 |
} else if (cp < 0x10000) { |
|
469
|
443 |
3 |
while (q < n && isalnum((unsigned char)s[q])) q++; |
|
|
387 |
56 |
while (q < n && isalnum((unsigned char)s[q])) q++; |
|
470
|
56 |
3 |
if (q == name_start || q >= n || s[q] != ';') return 0; |
|
|
53 |
3 |
if (q == name_start || q >= n || s[q] != ';') return 0; |
|
|
6 |
47 |
if (q == name_start || q >= n || s[q] != ';') return 0; |
|
472
|
9 |
38 |
if (!e) return 0; |
|
492
|
279 |
0 |
if (pos >= n || s[pos] != '<') return 0; |
|
|
0 |
279 |
if (pos >= n || s[pos] != '<') return 0; |
|
496
|
279 |
0 |
if (q >= n || !isalpha((unsigned char)s[q])) goto try_email; |
|
|
78 |
201 |
if (q >= n || !isalpha((unsigned char)s[q])) goto try_email; |
|
498
|
742 |
0 |
while (q < n && (isalnum((unsigned char)s[q]) || s[q] == '+' || |
|
|
517 |
225 |
while (q < n && (isalnum((unsigned char)s[q]) || s[q] == '+' || |
|
|
9 |
216 |
while (q < n && (isalnum((unsigned char)s[q]) || s[q] == '+' || |
|
499
|
6 |
210 |
s[q] == '.' || s[q] == '-')) |
|
|
9 |
201 |
s[q] == '.' || s[q] == '-')) |
|
502
|
135 |
66 |
if (scheme_len < 2 || scheme_len > 32) goto try_email; |
|
|
0 |
135 |
if (scheme_len < 2 || scheme_len > 32) goto try_email; |
|
503
|
135 |
0 |
if (q >= n || s[q] != ':') goto try_email; |
|
|
82 |
53 |
if (q >= n || s[q] != ':') goto try_email; |
|
507
|
848 |
50 |
while (r < n && s[r] != '>' && s[r] != '<' && |
|
508
|
898 |
0 |
!is_unicode_ws((unsigned char)s[r]) && |
|
509
|
845 |
0 |
(unsigned char)s[r] >= 0x20) |
|
511
|
53 |
0 |
if (r < n && s[r] == '>') { |
|
|
3 |
50 |
if (r < n && s[r] == '>') { |
|
522
|
953 |
0 |
while (q < n && (isalnum((unsigned char)s[q]) || |
|
|
616 |
337 |
while (q < n && (isalnum((unsigned char)s[q]) || |
|
523
|
108 |
229 |
strchr(".!#$%&'*+/=?^_`{|}~-", s[q]))) |
|
525
|
214 |
15 |
if (q == e_start || q >= n || s[q] != '@') return 0; |
|
|
214 |
0 |
if (q == e_start || q >= n || s[q] != '@') return 0; |
|
|
207 |
7 |
if (q == e_start || q >= n || s[q] != '@') return 0; |
|
527
|
111 |
0 |
while (q < n && s[q] != '>') { |
|
|
104 |
7 |
while (q < n && s[q] != '>') { |
|
529
|
88 |
16 |
if (isalnum((unsigned char)c)) { label_len++; q++; } |
|
530
|
3 |
13 |
else if (c == '-') { if (!label_len) return 0; label_len++; q++; } |
|
|
0 |
3 |
else if (c == '-') { if (!label_len) return 0; label_len++; q++; } |
|
531
|
13 |
0 |
else if (c == '.') { if (!label_len) return 0; dot_ok = 1; label_len = 0; q++; } |
|
|
0 |
13 |
else if (c == '.') { if (!label_len) return 0; dot_ok = 1; label_len = 0; q++; } |
|
533
|
0 |
104 |
if (label_len > 63) return 0; |
|
536
|
7 |
0 |
if (q >= n || s[q] != '>' || label_len == 0) return 0; |
|
|
7 |
0 |
if (q >= n || s[q] != '>' || label_len == 0) return 0; |
|
|
0 |
7 |
if (q >= n || s[q] != '>' || label_len == 0) return 0; |
|
547
|
81 |
321 |
if (first) return isalpha((unsigned char)c) || c == '_' || c == ':'; |
|
|
3 |
78 |
if (first) return isalpha((unsigned char)c) || c == '_' || c == ':'; |
|
|
0 |
3 |
if (first) return isalpha((unsigned char)c) || c == '_' || c == ':'; |
|
|
0 |
0 |
if (first) return isalpha((unsigned char)c) || c == '_' || c == ':'; |
|
548
|
84 |
237 |
return isalnum((unsigned char)c) || c == '_' || c == ':' || c == '.' || c == '-'; |
|
|
84 |
0 |
return isalnum((unsigned char)c) || c == '_' || c == ':' || c == '.' || c == '-'; |
|
|
81 |
3 |
return isalnum((unsigned char)c) || c == '_' || c == ':' || c == '.' || c == '-'; |
|
|
81 |
0 |
return isalnum((unsigned char)c) || c == '_' || c == ':' || c == '.' || c == '-'; |
|
|
0 |
81 |
return isalnum((unsigned char)c) || c == '_' || c == ':' || c == '.' || c == '-'; |
|
556
|
220 |
0 |
if (pos >= n || s[pos] != '<') return 0; |
|
|
0 |
220 |
if (pos >= n || s[pos] != '<') return 0; |
|
557
|
0 |
220 |
if (pos + 1 >= n) return 0; |
|
561
|
217 |
3 |
if (q + 2 < n && s[q] == '!' && s[q+1] == '-' && s[q+2] == '-') { |
|
|
21 |
196 |
if (q + 2 < n && s[q] == '!' && s[q+1] == '-' && s[q+2] == '-') { |
|
|
12 |
9 |
if (q + 2 < n && s[q] == '!' && s[q+1] == '-' && s[q+2] == '-') { |
|
|
9 |
3 |
if (q + 2 < n && s[q] == '!' && s[q+1] == '-' && s[q+2] == '-') { |
|
564
|
9 |
0 |
if (r < n && s[r] == '>') { |
|
|
3 |
6 |
if (r < n && s[r] == '>') { |
|
571
|
6 |
0 |
if (r + 1 < n && s[r] == '-' && s[r+1] == '>') { |
|
|
3 |
3 |
if (r + 1 < n && s[r] == '-' && s[r+1] == '>') { |
|
|
3 |
0 |
if (r + 1 < n && s[r] == '-' && s[r+1] == '>') { |
|
579
|
114 |
0 |
while (r + 2 < n) { |
|
580
|
12 |
102 |
if (s[r] == '-' && s[r+1] == '-' && s[r+2] == '>') { |
|
|
6 |
6 |
if (s[r] == '-' && s[r+1] == '-' && s[r+2] == '>') { |
|
|
3 |
3 |
if (s[r] == '-' && s[r+1] == '-' && s[r+2] == '>') { |
|
592
|
211 |
0 |
if (q < n && s[q] == '?') { |
|
|
3 |
208 |
if (q < n && s[q] == '?') { |
|
594
|
42 |
0 |
while (q + 1 < n) { |
|
595
|
3 |
39 |
if (s[q] == '?' && s[q+1] == '>') { |
|
|
3 |
0 |
if (s[q] == '?' && s[q+1] == '>') { |
|
607
|
175 |
33 |
if (q + 7 < n && memcmp(s + q, "![CDATA[", 8) == 0) { |
|
|
3 |
172 |
if (q + 7 < n && memcmp(s + q, "![CDATA[", 8) == 0) { |
|
609
|
12 |
0 |
while (q + 2 < n) { |
|
610
|
3 |
9 |
if (s[q] == ']' && s[q+1] == ']' && s[q+2] == '>') { |
|
|
3 |
0 |
if (s[q] == ']' && s[q+1] == ']' && s[q+2] == '>') { |
|
|
3 |
0 |
if (s[q] == ']' && s[q+1] == ']' && s[q+2] == '>') { |
|
622
|
205 |
0 |
if (q < n && s[q] == '!' && q + 1 < n && isalpha((unsigned char)s[q+1])) { |
|
|
9 |
196 |
if (q < n && s[q] == '!' && q + 1 < n && isalpha((unsigned char)s[q+1])) { |
|
|
9 |
0 |
if (q < n && s[q] == '!' && q + 1 < n && isalpha((unsigned char)s[q+1])) { |
|
|
3 |
6 |
if (q < n && s[q] == '!' && q + 1 < n && isalpha((unsigned char)s[q+1])) { |
|
624
|
48 |
0 |
while (q < n && s[q] != '>') q++; |
|
|
45 |
3 |
while (q < n && s[q] != '>') q++; |
|
625
|
0 |
3 |
if (q >= n) return 0; |
|
634
|
202 |
0 |
if (q < n && s[q] == '/') { closing = 1; q++; } |
|
|
32 |
170 |
if (q < n && s[q] == '/') { closing = 1; q++; } |
|
636
|
202 |
0 |
if (q >= n || !isalpha((unsigned char)s[q])) return 0; |
|
|
27 |
175 |
if (q >= n || !isalpha((unsigned char)s[q])) return 0; |
|
638
|
516 |
0 |
while (q < n && (isalnum((unsigned char)s[q]) || s[q] == '-')) q++; |
|
|
338 |
178 |
while (q < n && (isalnum((unsigned char)s[q]) || s[q] == '-')) q++; |
|
|
3 |
175 |
while (q < n && (isalnum((unsigned char)s[q]) || s[q] == '-')) q++; |
|
639
|
32 |
143 |
if (closing) { |
|
640
|
38 |
0 |
while (q < n && (s[q] == ' ' || s[q] == '\t' || s[q] == '\n')) q++; |
|
|
6 |
32 |
while (q < n && (s[q] == ' ' || s[q] == '\t' || s[q] == '\n')) q++; |
|
|
0 |
32 |
while (q < n && (s[q] == ' ' || s[q] == '\t' || s[q] == '\n')) q++; |
|
|
0 |
32 |
while (q < n && (s[q] == ' ' || s[q] == '\t' || s[q] == '\n')) q++; |
|
641
|
32 |
0 |
if (q >= n || s[q] != '>') return 0; |
|
|
3 |
29 |
if (q >= n || s[q] != '>') return 0; |
|
649
|
218 |
0 |
while (q < n) { |
|
653
|
314 |
0 |
while (q < n && (s[q] == ' ' || s[q] == '\t' || s[q] == '\n')) { |
|
|
84 |
230 |
while (q < n && (s[q] == ' ' || s[q] == '\t' || s[q] == '\n')) { |
|
|
0 |
230 |
while (q < n && (s[q] == ' ' || s[q] == '\t' || s[q] == '\n')) { |
|
|
12 |
218 |
while (q < n && (s[q] == ' ' || s[q] == '\t' || s[q] == '\n')) { |
|
656
|
0 |
218 |
if (q >= n) return 0; |
|
657
|
138 |
80 |
if (s[q] == '>' || s[q] == '/') break; |
|
|
117 |
21 |
if (s[q] == '>' || s[q] == '/') break; |
|
658
|
36 |
81 |
if (!saw_ws) return 0; |
|
659
|
0 |
81 |
if (!html_attr_name_char(s[q], 1)) { q = pre_attr; break; } |
|
661
|
321 |
0 |
while (q < n && html_attr_name_char(s[q], 0)) q++; |
|
|
240 |
81 |
while (q < n && html_attr_name_char(s[q], 0)) q++; |
|
664
|
87 |
0 |
while (q < n && (s[q] == ' ' || s[q] == '\t' || s[q] == '\n')) q++; |
|
|
6 |
81 |
while (q < n && (s[q] == ' ' || s[q] == '\t' || s[q] == '\n')) q++; |
|
|
0 |
81 |
while (q < n && (s[q] == ' ' || s[q] == '\t' || s[q] == '\n')) q++; |
|
|
0 |
81 |
while (q < n && (s[q] == ' ' || s[q] == '\t' || s[q] == '\n')) q++; |
|
665
|
81 |
0 |
if (q < n && s[q] == '=') { |
|
|
69 |
12 |
if (q < n && s[q] == '=') { |
|
667
|
72 |
0 |
while (q < n && (s[q] == ' ' || s[q] == '\t' || s[q] == '\n')) q++; |
|
|
3 |
69 |
while (q < n && (s[q] == ' ' || s[q] == '\t' || s[q] == '\n')) q++; |
|
|
0 |
69 |
while (q < n && (s[q] == ' ' || s[q] == '\t' || s[q] == '\n')) q++; |
|
|
0 |
69 |
while (q < n && (s[q] == ' ' || s[q] == '\t' || s[q] == '\n')) q++; |
|
668
|
69 |
0 |
if (q < n && (s[q] == '"' || s[q] == '\'')) { |
|
|
15 |
54 |
if (q < n && (s[q] == '"' || s[q] == '\'')) { |
|
|
6 |
9 |
if (q < n && (s[q] == '"' || s[q] == '\'')) { |
|
670
|
360 |
6 |
while (q < n && s[q] != qc) q++; |
|
|
306 |
54 |
while (q < n && s[q] != qc) q++; |
|
671
|
6 |
54 |
if (q >= n) return 0; |
|
676
|
42 |
3 |
while (q < n && s[q] != ' ' && s[q] != '\t' && s[q] != '\n' && |
|
|
42 |
0 |
while (q < n && s[q] != ' ' && s[q] != '\t' && s[q] != '\n' && |
|
|
39 |
3 |
while (q < n && s[q] != ' ' && s[q] != '\t' && s[q] != '\n' && |
|
677
|
39 |
0 |
s[q] != '"' && s[q] != '\'' && s[q] != '=' && |
|
|
36 |
3 |
s[q] != '"' && s[q] != '\'' && s[q] != '=' && |
|
|
36 |
0 |
s[q] != '"' && s[q] != '\'' && s[q] != '=' && |
|
678
|
45 |
0 |
s[q] != '<' && s[q] != '>' && s[q] != '`') q++; |
|
|
36 |
0 |
s[q] != '<' && s[q] != '>' && s[q] != '`') q++; |
|
|
36 |
0 |
s[q] != '<' && s[q] != '>' && s[q] != '`') q++; |
|
|
36 |
0 |
s[q] != '<' && s[q] != '>' && s[q] != '`') q++; |
|
679
|
0 |
9 |
if (q == vs) return 0; |
|
685
|
101 |
0 |
while (q < n && (s[q] == ' ' || s[q] == '\t' || s[q] == '\n')) q++; |
|
|
0 |
101 |
while (q < n && (s[q] == ' ' || s[q] == '\t' || s[q] == '\n')) q++; |
|
|
0 |
101 |
while (q < n && (s[q] == ' ' || s[q] == '\t' || s[q] == '\n')) q++; |
|
|
0 |
101 |
while (q < n && (s[q] == ' ' || s[q] == '\t' || s[q] == '\n')) q++; |
|
686
|
101 |
0 |
if (q < n && s[q] == '/') q++; |
|
|
21 |
80 |
if (q < n && s[q] == '/') q++; |
|
687
|
101 |
0 |
if (q >= n || s[q] != '>') return 0; |
|
|
3 |
98 |
if (q >= n || s[q] != '>') return 0; |
|
705
|
0 |
220 |
if (p >= n) return 0; |
|
706
|
30 |
190 |
if (s[p] == '<') { |
|
709
|
147 |
3 |
while (p < n && s[p] != '>' && s[p] != '<' && s[p] != '\n') { |
|
|
126 |
21 |
while (p < n && s[p] != '>' && s[p] != '<' && s[p] != '\n') { |
|
|
126 |
0 |
while (p < n && s[p] != '>' && s[p] != '<' && s[p] != '\n') { |
|
|
120 |
6 |
while (p < n && s[p] != '>' && s[p] != '<' && s[p] != '\n') { |
|
710
|
3 |
117 |
if (s[p] == '\\' && p + 1 < n) p++; |
|
|
3 |
0 |
if (s[p] == '\\' && p + 1 < n) p++; |
|
713
|
27 |
3 |
if (p >= n || s[p] != '>') return 0; |
|
|
6 |
21 |
if (p >= n || s[p] != '>') return 0; |
|
721
|
1551 |
3 |
while (p < n) { |
|
723
|
1545 |
6 |
if (c < 0x20 || c == 0x7f) break; |
|
|
1545 |
0 |
if (c < 0x20 || c == 0x7f) break; |
|
724
|
1498 |
47 |
if (c == ' ' || c == '\t' || c == '\n') break; |
|
|
1498 |
0 |
if (c == ' ' || c == '\t' || c == '\n') break; |
|
|
1498 |
0 |
if (c == ' ' || c == '\t' || c == '\n') break; |
|
725
|
27 |
1471 |
if (c == '\\' && p + 1 < n && is_ascii_punct((unsigned char)s[p+1])) { p += 2; continue; } |
|
|
27 |
0 |
if (c == '\\' && p + 1 < n && is_ascii_punct((unsigned char)s[p+1])) { p += 2; continue; } |
|
|
24 |
3 |
if (c == '\\' && p + 1 < n && is_ascii_punct((unsigned char)s[p+1])) { p += 2; continue; } |
|
726
|
15 |
1459 |
if (c == '(') { paren++; p++; continue; } |
|
727
|
149 |
1310 |
if (c == ')') { if (paren == 0) break; paren--; p++; continue; } |
|
|
134 |
15 |
if (c == ')') { if (paren == 0) break; paren--; p++; continue; } |
|
730
|
190 |
0 |
if (p == ds || paren != 0) return 0; |
|
|
0 |
190 |
if (p == ds || paren != 0) return 0; |
|
743
|
0 |
41 |
if (p >= n) return 0; |
|
745
|
12 |
29 |
if (open == '"' || open == '\'') close = open; |
|
|
9 |
3 |
if (open == '"' || open == '\'') close = open; |
|
746
|
3 |
0 |
else if (open == '(') close = ')'; |
|
751
|
339 |
0 |
while (p < n && s[p] != close) { |
|
|
298 |
41 |
while (p < n && s[p] != close) { |
|
752
|
6 |
292 |
if (s[p] == '\\' && p + 1 < n && is_ascii_punct((unsigned char)s[p+1])) { p += 2; continue; } |
|
|
6 |
0 |
if (s[p] == '\\' && p + 1 < n && is_ascii_punct((unsigned char)s[p+1])) { p += 2; continue; } |
|
|
6 |
0 |
if (s[p] == '\\' && p + 1 < n && is_ascii_punct((unsigned char)s[p+1])) { p += 2; continue; } |
|
753
|
15 |
277 |
if (open == '(' && s[p] == '(') return 0; |
|
|
0 |
15 |
if (open == '(' && s[p] == '(') return 0; |
|
754
|
0 |
292 |
if (s[p] == '\n') { |
|
757
|
0 |
0 |
while (r < n && (s[r] == ' ' || s[r] == '\t')) r++; |
|
|
0 |
0 |
while (r < n && (s[r] == ' ' || s[r] == '\t')) r++; |
|
|
0 |
0 |
while (r < n && (s[r] == ' ' || s[r] == '\t')) r++; |
|
758
|
0 |
0 |
if (r >= n || s[r] == '\n') { prev_blank_line = 1; break; } |
|
|
0 |
0 |
if (r >= n || s[r] == '\n') { prev_blank_line = 1; break; } |
|
762
|
41 |
0 |
if (prev_blank_line || p >= n || s[p] != close) return 0; |
|
|
41 |
0 |
if (prev_blank_line || p >= n || s[p] != close) return 0; |
|
|
0 |
41 |
if (prev_blank_line || p >= n || s[p] != close) return 0; |
|
774
|
1835 |
16 |
for (x = z->tail; x; x = x->prev) { |
|
775
|
1213 |
622 |
if (x->type == N_OPEN_BRACKET || x->type == N_OPEN_BANG) { |
|
|
85 |
1128 |
if (x->type == N_OPEN_BRACKET || x->type == N_OPEN_BANG) { |
|
786
|
260 |
343 |
for (p = x->prev; p; p = p->prev) { |
|
787
|
30 |
230 |
if (p->type == N_OPEN_BRACKET) p->active = 0; |
|
799
|
413 |
9 |
if (c->children) c->children->prev = NULL; |
|
802
|
127 |
295 |
if (z->tail) z->tail->next = NULL; |
|
836
|
6384 |
2128 |
for (a = 0; a < 3; a++) |
|
837
|
19152 |
6384 |
for (b = 0; b < 3; b++) |
|
838
|
38304 |
19152 |
for (c = 0; c < 2; c++) |
|
841
|
422 |
1706 |
closer = stack_bottom ? stack_bottom->next : z->head; |
|
843
|
5333 |
1610 |
while (closer) { |
|
844
|
1297 |
4036 |
if (closer->type == N_DELIM && closer->can_close && |
|
|
518 |
779 |
if (closer->type == N_DELIM && closer->can_close && |
|
845
|
182 |
336 |
(closer->delim_char == '*' || closer->delim_char == '_' || |
|
|
26 |
156 |
(closer->delim_char == '*' || closer->delim_char == '_' || |
|
846
|
0 |
26 |
closer->delim_char == '~')) |
|
850
|
776 |
2128 |
while (closer) { |
|
852
|
276 |
500 |
int didx = (ch == '*') ? 0 : (ch == '_') ? 1 : 2; |
|
|
244 |
32 |
int didx = (ch == '*') ? 0 : (ch == '_') ? 1 : 2; |
|
860
|
1819 |
132 |
while (opener && opener != bot && opener != stack_bottom) { |
|
|
1786 |
33 |
while (opener && opener != bot && opener != stack_bottom) { |
|
|
1786 |
0 |
while (opener && opener != bot && opener != stack_bottom) { |
|
861
|
716 |
1070 |
if (opener->type == N_DELIM && opener->can_open && |
|
|
662 |
54 |
if (opener->type == N_DELIM && opener->can_open && |
|
862
|
626 |
36 |
opener->delim_char == ch) { |
|
864
|
18 |
539 |
int odd_match = (closer->can_open || opener->can_close) && |
|
865
|
557 |
69 |
((opener->count + closer->count) % 3 == 0) && |
|
|
21 |
66 |
((opener->count + closer->count) % 3 == 0) && |
|
866
|
6 |
15 |
!(opener->count % 3 == 0 && closer->count % 3 == 0); |
|
|
0 |
6 |
!(opener->count % 3 == 0 && closer->count % 3 == 0); |
|
867
|
611 |
15 |
if (!odd_match) { found = 1; break; } |
|
871
|
165 |
611 |
if (!found) { |
|
875
|
105 |
60 |
if (!closer->can_open) closer->can_close = 0; |
|
877
|
210 |
105 |
while (closer) { |
|
878
|
63 |
147 |
if (closer->type == N_DELIM && closer->can_close && |
|
|
60 |
3 |
if (closer->type == N_DELIM && closer->can_close && |
|
879
|
18 |
42 |
(closer->delim_char == '*' || closer->delim_char == '_' || |
|
|
0 |
18 |
(closer->delim_char == '*' || closer->delim_char == '_' || |
|
880
|
0 |
0 |
closer->delim_char == '~')) |
|
889
|
29 |
582 |
: ((opener->count >= 2 && closer->count >= 2) ? 2 : 1); |
|
|
256 |
326 |
: ((opener->count >= 2 && closer->count >= 2) ? 2 : 1); |
|
|
238 |
18 |
: ((opener->count >= 2 && closer->count >= 2) ? 2 : 1); |
|
892
|
29 |
582 |
if (ch == '~' && (opener->count != closer->count || |
|
|
26 |
3 |
if (ch == '~' && (opener->count != closer->count || |
|
893
|
17 |
9 |
(opener->count != 1 && opener->count != 2))) { |
|
|
0 |
17 |
(opener->count != 1 && opener->count != 2))) { |
|
897
|
0 |
3 |
while (closer) { |
|
898
|
0 |
0 |
if (closer->type == N_DELIM && closer->can_close && |
|
|
0 |
0 |
if (closer->type == N_DELIM && closer->can_close && |
|
899
|
0 |
0 |
(closer->delim_char == '*' || closer->delim_char == '_' || |
|
|
0 |
0 |
(closer->delim_char == '*' || closer->delim_char == '_' || |
|
900
|
0 |
0 |
closer->delim_char == '~')) |
|
907
|
582 |
26 |
tt = (ch == '~') ? N_STRIKE : (use2 == 2 ? N_STRONG : N_EMPH); |
|
|
238 |
344 |
tt = (ch == '~') ? N_STRIKE : (use2 == 2 ? N_STRONG : N_EMPH); |
|
909
|
344 |
264 |
if ((tt == N_EMPH && (_ifl & MDS_FLAG_NO_EMPH)) || |
|
|
343 |
1 |
if ((tt == N_EMPH && (_ifl & MDS_FLAG_NO_EMPH)) || |
|
|
238 |
369 |
if ((tt == N_EMPH && (_ifl & MDS_FLAG_NO_EMPH)) || |
|
910
|
1 |
237 |
(tt == N_STRONG && (_ifl & MDS_FLAG_NO_STRONG))) { |
|
913
|
2 |
0 |
if (!closer->can_open) closer->can_close = 0; |
|
915
|
0 |
2 |
while (closer) { |
|
916
|
0 |
0 |
if (closer->type == N_DELIM && closer->can_close && |
|
|
0 |
0 |
if (closer->type == N_DELIM && closer->can_close && |
|
917
|
0 |
0 |
(closer->delim_char == '*' || closer->delim_char == '_' || |
|
|
0 |
0 |
(closer->delim_char == '*' || closer->delim_char == '_' || |
|
918
|
0 |
0 |
closer->delim_char == '~')) |
|
928
|
606 |
0 |
if (first != closer) { |
|
942
|
65 |
541 |
new_open = (opener->count > 0) ? opener : NULL; |
|
943
|
71 |
535 |
new_close = (closer->count > 0) ? closer : NULL; |
|
948
|
65 |
541 |
if (new_open) { |
|
953
|
71 |
535 |
if (new_close) { |
|
960
|
65 |
541 |
if (new_open) { |
|
961
|
11 |
54 |
if (prev_link) prev_link->next = new_open; |
|
966
|
341 |
265 |
if (prev_link) prev_link->next = container; |
|
970
|
71 |
535 |
if (new_close) { |
|
976
|
225 |
381 |
if (after) after->prev = prev_link; |
|
981
|
71 |
535 |
if (new_close) { |
|
985
|
444 |
408 |
while (closer) { |
|
986
|
158 |
286 |
if (closer->type == N_DELIM && closer->can_close && |
|
|
127 |
31 |
if (closer->type == N_DELIM && closer->can_close && |
|
987
|
58 |
69 |
(closer->delim_char == '*' || closer->delim_char == '_' || |
|
|
6 |
52 |
(closer->delim_char == '*' || closer->delim_char == '_' || |
|
988
|
0 |
6 |
closer->delim_char == '~')) |
|
995
|
422 |
1706 |
start = stack_bottom ? stack_bottom->next : z->head; |
|
996
|
4608 |
2128 |
for (p = start; p; p = p->next) { |
|
997
|
406 |
4202 |
if (p->type == N_DELIM) { |
|
1019
|
16 |
707 |
if (!opener) { |
|
1028
|
21 |
686 |
if (!opener->active) { |
|
1040
|
118 |
568 |
if ((z->ctx->flags & MDS_FLAG_FOOTNOTES) && z->ctx->footnotes) { |
|
|
27 |
91 |
if ((z->ctx->flags & MDS_FLAG_FOOTNOTES) && z->ctx->footnotes) { |
|
1043
|
27 |
0 |
if (txt_e0 > txt_s0 && s[txt_s0] == '^') { |
|
|
27 |
0 |
if (txt_e0 > txt_s0 && s[txt_s0] == '^') { |
|
1048
|
24 |
3 |
if (fn) { |
|
1056
|
3 |
21 |
if (opener->type == N_OPEN_BANG) { |
|
1083
|
505 |
157 |
if (p < n && s[p] == '(') { |
|
|
229 |
276 |
if (p < n && s[p] == '(') { |
|
1085
|
238 |
0 |
while (q < n && (s[q] == ' ' || s[q] == '\t' || s[q] == '\n')) q++; |
|
|
9 |
229 |
while (q < n && (s[q] == ' ' || s[q] == '\t' || s[q] == '\n')) q++; |
|
|
0 |
229 |
while (q < n && (s[q] == ' ' || s[q] == '\t' || s[q] == '\n')) q++; |
|
|
0 |
229 |
while (q < n && (s[q] == ' ' || s[q] == '\t' || s[q] == '\n')) q++; |
|
1086
|
229 |
0 |
if (q < n && s[q] != ')') { |
|
|
220 |
9 |
if (q < n && s[q] != ')') { |
|
1087
|
211 |
9 |
if (parse_link_destination(s, &q, n, &href_s, &hlen)) { |
|
1089
|
267 |
3 |
while (q < n && (s[q] == ' ' || s[q] == '\t' || s[q] == '\n')) q++; |
|
|
50 |
217 |
while (q < n && (s[q] == ' ' || s[q] == '\t' || s[q] == '\n')) q++; |
|
|
0 |
217 |
while (q < n && (s[q] == ' ' || s[q] == '\t' || s[q] == '\n')) q++; |
|
|
9 |
208 |
while (q < n && (s[q] == ' ' || s[q] == '\t' || s[q] == '\n')) q++; |
|
1090
|
208 |
3 |
if (q < n && (s[q] == '"' || s[q] == '\'' || s[q] == '(')) { |
|
|
179 |
29 |
if (q < n && (s[q] == '"' || s[q] == '\'' || s[q] == '(')) { |
|
|
170 |
9 |
if (q < n && (s[q] == '"' || s[q] == '\'' || s[q] == '(')) { |
|
|
3 |
167 |
if (q < n && (s[q] == '"' || s[q] == '\'' || s[q] == '(')) { |
|
1091
|
0 |
41 |
if (!parse_link_title(s, &q, n, &title_s, &tlen)) { |
|
1095
|
56 |
0 |
while (q < n && (s[q] == ' ' || s[q] == '\t' || s[q] == '\n')) q++; |
|
|
15 |
41 |
while (q < n && (s[q] == ' ' || s[q] == '\t' || s[q] == '\n')) q++; |
|
|
0 |
41 |
while (q < n && (s[q] == ' ' || s[q] == '\t' || s[q] == '\n')) q++; |
|
|
0 |
41 |
while (q < n && (s[q] == ' ' || s[q] == '\t' || s[q] == '\n')) q++; |
|
1098
|
208 |
3 |
if (q < n && s[q] == ')') { |
|
|
187 |
21 |
if (q < n && s[q] == ')') { |
|
1103
|
9 |
0 |
} else if (q < n && s[q] == ')') { |
|
|
9 |
0 |
} else if (q < n && s[q] == ')') { |
|
1112
|
466 |
196 |
if (!matched && z->ctx->refs) { |
|
|
256 |
210 |
if (!matched && z->ctx->refs) { |
|
1123
|
139 |
117 |
if (p < n && s[p] == '[') { |
|
|
105 |
34 |
if (p < n && s[p] == '[') { |
|
1126
|
337 |
0 |
while (q < n && s[q] != ']' && s[q] != '[' && q - lbl_s < 1000) { |
|
|
232 |
105 |
while (q < n && s[q] != ']' && s[q] != '[' && q - lbl_s < 1000) { |
|
|
232 |
0 |
while (q < n && s[q] != ']' && s[q] != '[' && q - lbl_s < 1000) { |
|
|
232 |
0 |
while (q < n && s[q] != ']' && s[q] != '[' && q - lbl_s < 1000) { |
|
1127
|
6 |
226 |
if (s[q] == '\\' && q + 1 < n) q++; |
|
|
6 |
0 |
if (s[q] == '\\' && q + 1 < n) q++; |
|
1130
|
105 |
0 |
if (q < n && s[q] == ']' && q > lbl_s) { |
|
|
105 |
0 |
if (q < n && s[q] == ']' && q > lbl_s) { |
|
|
71 |
34 |
if (q < n && s[q] == ']' && q > lbl_s) { |
|
1133
|
62 |
9 |
if (refent) { p = q + 1; is_ref = 1; matched = 1; } |
|
1134
|
34 |
0 |
} else if (q < n && s[q] == ']' && q == lbl_s) { |
|
|
34 |
0 |
} else if (q < n && s[q] == ']' && q == lbl_s) { |
|
|
34 |
0 |
} else if (q < n && s[q] == ']' && q == lbl_s) { |
|
1137
|
34 |
0 |
if (refent) { p = q + 1; is_ref = 1; matched = 1; } |
|
1140
|
160 |
96 |
if (!matched && !tried_full) { |
|
|
151 |
9 |
if (!matched && !tried_full) { |
|
1143
|
130 |
21 |
if (refent) { is_ref = 1; matched = 1; } |
|
1145
|
226 |
30 |
if (matched && refent) { |
|
|
226 |
0 |
if (matched && refent) { |
|
1151
|
240 |
422 |
if (!matched) { |
|
1164
|
79 |
343 |
t = is_image ? N_IMAGE : N_LINK; |
|
1171
|
127 |
295 |
if (opener->prev) opener->prev->next = container; |
|
1176
|
343 |
79 |
if (!is_image) deactivate_brackets(z, container); |
|
1251
|
762 |
1459 |
if (!m) return 8; |
|
1267
|
7177 |
1706 |
while (pos < n) { |
|
1272
|
294 |
9 |
if (pos + 1 < n && s[pos+1] == '\n') { |
|
|
13 |
281 |
if (pos + 1 < n && s[pos+1] == '\n') { |
|
1274
|
13 |
0 |
FLUSH_TEXT(); |
|
1279
|
19 |
0 |
while (pos < n && (s[pos] == ' ' || s[pos] == '\t')) pos++; |
|
|
6 |
13 |
while (pos < n && (s[pos] == ' ' || s[pos] == '\t')) pos++; |
|
|
0 |
13 |
while (pos < n && (s[pos] == ' ' || s[pos] == '\t')) pos++; |
|
1283
|
281 |
9 |
if (pos + 1 < n && is_ascii_punct((unsigned char)s[pos+1])) { |
|
|
254 |
27 |
if (pos + 1 < n && is_ascii_punct((unsigned char)s[pos+1])) { |
|
1284
|
67 |
187 |
FLUSH_TEXT(); |
|
1296
|
2 |
189 |
if (z->ctx->flags & MDS_FLAG_NO_CODE) { |
|
1299
|
4 |
0 |
while (r < n && s[r] == '`') r++; |
|
|
2 |
2 |
while (r < n && s[r] == '`') r++; |
|
1300
|
2 |
0 |
FLUSH_TEXT(); |
|
1323
|
144 |
45 |
if (end && z->tail && z->tail->type == N_CODE) { |
|
|
144 |
0 |
if (end && z->tail && z->tail->type == N_CODE) { |
|
|
144 |
0 |
if (end && z->tail && z->tail->type == N_CODE) { |
|
1326
|
48 |
96 |
if (z->tail) z->tail->next = NULL; |
|
1330
|
71 |
118 |
if (saved_pos > text_start) |
|
1335
|
144 |
45 |
if (end2) { |
|
1340
|
72 |
27 |
while (r < n && s[r] == '`') r++; |
|
|
54 |
18 |
while (r < n && s[r] == '`') r++; |
|
1347
|
117 |
162 |
FLUSH_TEXT(); |
|
1349
|
57 |
222 |
if (end) { pos += end; text_start = pos; continue; } |
|
1350
|
220 |
2 |
if (!(z->ctx->flags & MDS_FLAG_NO_HTML)) { |
|
1352
|
145 |
75 |
if (end) { pos += end; text_start = pos; continue; } |
|
1360
|
79 |
33 |
if (consumed) { |
|
1365
|
79 |
0 |
if (z->tail && before > text_start) { |
|
|
52 |
27 |
if (z->tail && before > text_start) { |
|
1369
|
49 |
3 |
if (z->tail) z->tail->next = NULL; |
|
1375
|
52 |
0 |
if (z->tail) z->tail->next = added; |
|
1391
|
979 |
561 |
FLUSH_TEXT(); |
|
1393
|
3562 |
422 |
while (pos < n && (unsigned char)s[pos] == c) pos++; |
|
|
2444 |
1118 |
while (pos < n && (unsigned char)s[pos] == c) pos++; |
|
1395
|
92 |
1448 |
if (c == '~' && ((runlen != 1 && runlen != 2) || !(z->ctx->flags & MDS_FLAG_STRIKE))) { |
|
|
55 |
37 |
if (c == '~' && ((runlen != 1 && runlen != 2) || !(z->ctx->flags & MDS_FLAG_STRIKE))) { |
|
|
43 |
12 |
if (c == '~' && ((runlen != 1 && runlen != 2) || !(z->ctx->flags & MDS_FLAG_STRIKE))) { |
|
|
10 |
70 |
if (c == '~' && ((runlen != 1 && runlen != 2) || !(z->ctx->flags & MDS_FLAG_STRIKE))) { |
|
1414
|
1 |
658 |
if (z->ctx->flags & MDS_FLAG_NO_LINKS) { |
|
1415
|
0 |
1 |
FLUSH_TEXT(); |
|
1419
|
108 |
550 |
FLUSH_TEXT(); |
|
1428
|
98 |
15 |
if (pos + 1 < n && s[pos+1] == '[' && |
|
|
86 |
12 |
if (pos + 1 < n && s[pos+1] == '[' && |
|
1429
|
85 |
1 |
!(z->ctx->flags & MDS_FLAG_NO_IMAGES)) { |
|
1431
|
13 |
72 |
FLUSH_TEXT(); |
|
1443
|
573 |
150 |
FLUSH_TEXT(); |
|
1445
|
446 |
277 |
if (try_close_bracket(z, &p2)) { |
|
1457
|
282 |
56 |
FLUSH_TEXT(); |
|
1460
|
338 |
0 |
if (z->tail && z->tail->type == N_TEXT) { |
|
|
300 |
38 |
if (z->tail && z->tail->type == N_TEXT) { |
|
1462
|
278 |
22 |
if (t->n >= 2 && t->s[t->n - 1] == ' ' && t->s[t->n - 2] == ' ') { |
|
|
19 |
259 |
if (t->n >= 2 && t->s[t->n - 1] == ' ' && t->s[t->n - 2] == ' ') { |
|
|
16 |
3 |
if (t->n >= 2 && t->s[t->n - 1] == ' ' && t->s[t->n - 2] == ' ') { |
|
1464
|
72 |
0 |
while (t->n > 0 && t->s[t->n - 1] == ' ') t->n--; |
|
|
56 |
16 |
while (t->n > 0 && t->s[t->n - 1] == ' ') t->n--; |
|
1465
|
0 |
16 |
if (t->n == 0) { |
|
1468
|
0 |
0 |
if (z->tail) z->tail->next = NULL; |
|
1472
|
284 |
0 |
} else if (t->n >= 1 && t->s[t->n - 1] == ' ') { |
|
|
9 |
275 |
} else if (t->n >= 1 && t->s[t->n - 1] == ' ') { |
|
1475
|
6 |
3 |
if (t->n == 0) { |
|
1477
|
6 |
0 |
if (z->tail) z->tail->next = NULL; |
|
1482
|
16 |
322 |
br = node_new(z, hard ? N_LINEBREAK : N_SOFTBREAK); |
|
1486
|
503 |
0 |
while (pos < n && (s[pos] == ' ' || s[pos] == '\t')) pos++; |
|
|
165 |
338 |
while (pos < n && (s[pos] == ' ' || s[pos] == '\t')) pos++; |
|
|
0 |
338 |
while (pos < n && (s[pos] == ' ' || s[pos] == '\t')) pos++; |
|
1502
|
2221 |
1460 |
while (pos + 8 <= n) { |
|
1505
|
1459 |
762 |
if (k < 8) goto next_iter; |
|
1509
|
586 |
5108 |
while (pos < n && !mds_inline_interest[(unsigned char)s[pos]]) |
|
|
4234 |
874 |
while (pos < n && !mds_inline_interest[(unsigned char)s[pos]]) |
|
1516
|
610 |
1096 |
FLUSH_TEXT(); |
|
1526
|
0 |
3918 |
if (n == 0) return; |
|
1527
|
3918 |
0 |
if (z->ctx->cb.text) z->ctx->cb.text(z->ctx->ud, s, n); |
|
1530
|
0 |
139 |
if (n == 0) return; |
|
1531
|
139 |
0 |
if (z->ctx->cb.raw) z->ctx->cb.raw(z->ctx->ud, s, n); |
|
1543
|
322 |
0 |
if (cb->enter_inline) cb->enter_inline(z->ctx->ud, MDS_INL_SOFTBREAK, &d); |
|
1544
|
322 |
0 |
if (cb->leave_inline) cb->leave_inline(z->ctx->ud, MDS_INL_SOFTBREAK); |
|
1547
|
29 |
0 |
if (cb->enter_inline) cb->enter_inline(z->ctx->ud, MDS_INL_LINEBREAK, &d); |
|
1548
|
29 |
0 |
if (cb->leave_inline) cb->leave_inline(z->ctx->ud, MDS_INL_LINEBREAK); |
|
1551
|
144 |
0 |
if (cb->enter_inline) cb->enter_inline(z->ctx->ud, MDS_INL_CODE, &d); |
|
1553
|
144 |
0 |
if (cb->leave_inline) cb->leave_inline(z->ctx->ud, MDS_INL_CODE); |
|
1559
|
57 |
0 |
if (cb->enter_inline) cb->enter_inline(z->ctx->ud, MDS_INL_AUTOLINK, &d); |
|
1560
|
57 |
0 |
if (cb->leave_inline) cb->leave_inline(z->ctx->ud, MDS_INL_AUTOLINK); |
|
1563
|
139 |
0 |
if (cb->enter_inline) cb->enter_inline(z->ctx->ud, MDS_INL_HTML_INLINE, &d); |
|
1565
|
139 |
0 |
if (cb->leave_inline) cb->leave_inline(z->ctx->ud, MDS_INL_HTML_INLINE); |
|
1568
|
343 |
0 |
if (cb->enter_inline) cb->enter_inline(z->ctx->ud, MDS_INL_EMPH, &d); |
|
1570
|
343 |
0 |
if (cb->leave_inline) cb->leave_inline(z->ctx->ud, MDS_INL_EMPH); |
|
1573
|
237 |
0 |
if (cb->enter_inline) cb->enter_inline(z->ctx->ud, MDS_INL_STRONG, &d); |
|
1575
|
237 |
0 |
if (cb->leave_inline) cb->leave_inline(z->ctx->ud, MDS_INL_STRONG); |
|
1578
|
26 |
0 |
if (cb->enter_inline) cb->enter_inline(z->ctx->ud, MDS_INL_STRIKE, &d); |
|
1580
|
26 |
0 |
if (cb->leave_inline) cb->leave_inline(z->ctx->ud, MDS_INL_STRIKE); |
|
1585
|
343 |
0 |
if (cb->enter_inline) cb->enter_inline(z->ctx->ud, MDS_INL_LINK, &d); |
|
1587
|
343 |
0 |
if (cb->leave_inline) cb->leave_inline(z->ctx->ud, MDS_INL_LINK); |
|
1593
|
79 |
0 |
if (cb->enter_inline) cb->enter_inline(z->ctx->ud, MDS_INL_IMAGE, &d); |
|
1595
|
79 |
0 |
if (cb->leave_inline) cb->leave_inline(z->ctx->ud, MDS_INL_IMAGE); |
|
1603
|
24 |
0 |
if (cb->enter_inline) cb->enter_inline(z->ctx->ud, MDS_INL_FOOTNOTE_REF, &d); |
|
1604
|
24 |
0 |
if (cb->leave_inline) cb->leave_inline(z->ctx->ud, MDS_INL_FOOTNOTE_REF); |
|
1617
|
5517 |
2734 |
for (p = head; p; p = p->next) emit_node(z, p); |
|
1624
|
0 |
3164 |
if (n == 0) return; |
|
1642
|
116057 |
1458 |
for (; p < end; p++) { |
|
1646
|
115747 |
310 |
if (c == '*' || c == '_' || c == '~' || c == '`' || |
|
|
115519 |
228 |
if (c == '*' || c == '_' || c == '~' || c == '`' || |
|
|
115486 |
33 |
if (c == '*' || c == '_' || c == '~' || c == '`' || |
|
|
115371 |
115 |
if (c == '*' || c == '_' || c == '~' || c == '`' || |
|
|
114895 |
476 |
if (c == '*' || c == '_' || c == '~' || c == '`' || |
|
1647
|
114895 |
0 |
c == '[' || c == ']' || c == '!' || c == '<' || |
|
|
114804 |
91 |
c == '[' || c == ']' || c == '!' || c == '<' || |
|
|
114640 |
164 |
c == '[' || c == ']' || c == '!' || c == '<' || |
|
|
114607 |
33 |
c == '[' || c == ']' || c == '!' || c == '<' || |
|
1648
|
114521 |
86 |
c == '&' || c == '\\' || c == '\n') break; |
|
|
114351 |
170 |
c == '&' || c == '\\' || c == '\n') break; |
|
1650
|
1458 |
1706 |
if (MDS_LIKELY(p == end)) { |
|
1655
|
1298 |
160 |
if (n < 2 || !(s[n-1] == ' ' && s[n-2] == ' ')) { |
|
|
0 |
1298 |
if (n < 2 || !(s[n-1] == ' ' && s[n-2] == ' ')) { |
|
|
0 |
0 |
if (n < 2 || !(s[n-1] == ' ' && s[n-2] == ' ')) { |
|
1656
|
1458 |
0 |
if (ctx->cb.text) ctx->cb.text(ctx->ud, s, n); |