breakout_parser 0.0.11 → 0.0.12
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.
- data/ChangeLog +12 -0
- data/ext/breakout_parser/lex.yy.c +622 -567
- data/ext/breakout_parser/parser.l +5 -0
- data/ext/breakout_parser/parser.tab.c +299 -248
- data/ext/breakout_parser/parser.tab.h +33 -31
- data/ext/breakout_parser/parser.y +73 -43
- data/ext/breakout_parser/ruby_ext.c +38 -10
- data/spec/parser_spec.rb +92 -8
- metadata +4 -2
@@ -141,6 +141,11 @@ extern size_t in_buf_len;
|
|
141
141
|
\[\[r:[0-9]+(\|[^\[\]]+)?\]\] { yylval.svalue = yytext+4; return SVN_REVISION_LINK; }
|
142
142
|
\[\[r:[0-9a-f]+(\|[^\[\]]+)?\]\] { yylval.svalue = yytext+4; return GIT_REVISION_LINK; }
|
143
143
|
|
144
|
+
\[\[revision:[0-9]+:[0-9]+(\|[^\[\]]+)?\]\] { yylval.svalue = yytext+11; return SVN_N_REVISION_LINK; }
|
145
|
+
\[\[revision:[0-9]+:[0-9a-f]+(\|[^\[\]]+)?\]\] { yylval.svalue = yytext+11; return GIT_N_REVISION_LINK; }
|
146
|
+
\[\[r:[0-9]+:[0-9]+(\|[^\[\]]+)?\]\] { yylval.svalue = yytext+4; return SVN_N_REVISION_LINK; }
|
147
|
+
\[\[r:[0-9]+:[0-9a-f]+(\|[^\[\]]+)?\]\] { yylval.svalue = yytext+4; return GIT_N_REVISION_LINK; }
|
148
|
+
|
144
149
|
\[\[url:[a-z]+:\/\/[^]]+\]\] { yylval.svalue = yytext+6; return URL_WITH_PROTO_LINK; }
|
145
150
|
\[\[url:\/[^]]+\]\] { yylval.svalue = yytext+6; return URL_WITH_PROTO_LINK; }
|
146
151
|
\[\[url:[^]]+\]\] { yylval.svalue = yytext+6; return URL_WITHOUT_PROTO_LINK; }
|
@@ -91,6 +91,11 @@ size_t bufsize = 0;
|
|
91
91
|
const char *space_name = NULL;
|
92
92
|
size_t space_name_len = 0;
|
93
93
|
|
94
|
+
const char *site_url = NULL;
|
95
|
+
size_t site_url_len = 0;
|
96
|
+
|
97
|
+
extern VALUE git_url;
|
98
|
+
|
94
99
|
#define CHECK_BUF_SIZE(len) \
|
95
100
|
if( (bufptr - buf + len + 1) >= bufsize ){ \
|
96
101
|
/*printf("[.] REALLOC oldsz=%d, newsz=%d\n",bufsize, (bufsize+((len > 0x1000) ? (len+0x1000) : 0x1000)));*/ \
|
@@ -130,7 +135,7 @@ void yyerror(const char *msg)
|
|
130
135
|
|
131
136
|
|
132
137
|
/* Line 189 of yacc.c */
|
133
|
-
#line
|
138
|
+
#line 139 "parser.tab.c"
|
134
139
|
|
135
140
|
/* Enabling traces. */
|
136
141
|
#ifndef YYDEBUG
|
@@ -169,35 +174,37 @@ void yyerror(const char *msg)
|
|
169
174
|
GIT_REVISION_LINK = 267,
|
170
175
|
WIKI_LINK = 268,
|
171
176
|
ANCHOR_LINK = 269,
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
177
|
+
SVN_N_REVISION_LINK = 270,
|
178
|
+
GIT_N_REVISION_LINK = 271,
|
179
|
+
URL_WITH_PROTO_LINK = 272,
|
180
|
+
URL_WITHOUT_PROTO_LINK = 273,
|
181
|
+
FILE_LINK = 274,
|
182
|
+
IMAGE_LINK = 275,
|
183
|
+
URL = 276,
|
184
|
+
EMAIL = 277,
|
185
|
+
UL = 278,
|
186
|
+
H1 = 279,
|
187
|
+
H2 = 280,
|
188
|
+
H3 = 281,
|
189
|
+
H4 = 282,
|
190
|
+
H5 = 283,
|
191
|
+
INLINE_CODE = 284,
|
192
|
+
SPACE = 285,
|
193
|
+
BR = 286,
|
194
|
+
OLI = 287,
|
195
|
+
ULI = 288,
|
196
|
+
PRE_CODE_START = 289,
|
197
|
+
PRE_CODE_END = 290,
|
198
|
+
PRE_START = 291,
|
199
|
+
PRE_END = 292,
|
200
|
+
CODE_START = 293,
|
201
|
+
CODE_END = 294,
|
202
|
+
NOTEXTILE_START = 295,
|
203
|
+
NOTEXTILE_END = 296,
|
204
|
+
BOLD_END = 297,
|
205
|
+
ITALIC_END = 298,
|
206
|
+
REVERT_BOLD = 299,
|
207
|
+
REVERT_ITALIC = 300
|
201
208
|
};
|
202
209
|
#endif
|
203
210
|
|
@@ -208,7 +215,7 @@ typedef union YYSTYPE
|
|
208
215
|
{
|
209
216
|
|
210
217
|
/* Line 214 of yacc.c */
|
211
|
-
#line
|
218
|
+
#line 66 "parser.y"
|
212
219
|
|
213
220
|
double dvalue;
|
214
221
|
int ivalue;
|
@@ -217,7 +224,7 @@ typedef union YYSTYPE
|
|
217
224
|
|
218
225
|
|
219
226
|
/* Line 214 of yacc.c */
|
220
|
-
#line
|
227
|
+
#line 228 "parser.tab.c"
|
221
228
|
} YYSTYPE;
|
222
229
|
# define YYSTYPE_IS_TRIVIAL 1
|
223
230
|
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
@@ -229,7 +236,7 @@ typedef union YYSTYPE
|
|
229
236
|
|
230
237
|
|
231
238
|
/* Line 264 of yacc.c */
|
232
|
-
#line
|
239
|
+
#line 240 "parser.tab.c"
|
233
240
|
|
234
241
|
#ifdef short
|
235
242
|
# undef short
|
@@ -442,22 +449,22 @@ union yyalloc
|
|
442
449
|
#endif
|
443
450
|
|
444
451
|
/* YYFINAL -- State number of the termination state. */
|
445
|
-
#define YYFINAL
|
452
|
+
#define YYFINAL 55
|
446
453
|
/* YYLAST -- Last index in YYTABLE. */
|
447
|
-
#define YYLAST
|
454
|
+
#define YYLAST 134
|
448
455
|
|
449
456
|
/* YYNTOKENS -- Number of terminals. */
|
450
|
-
#define YYNTOKENS
|
457
|
+
#define YYNTOKENS 46
|
451
458
|
/* YYNNTS -- Number of nonterminals. */
|
452
459
|
#define YYNNTS 28
|
453
460
|
/* YYNRULES -- Number of rules. */
|
454
|
-
#define YYNRULES
|
461
|
+
#define YYNRULES 70
|
455
462
|
/* YYNRULES -- Number of states. */
|
456
|
-
#define YYNSTATES
|
463
|
+
#define YYNSTATES 84
|
457
464
|
|
458
465
|
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
|
459
466
|
#define YYUNDEFTOK 2
|
460
|
-
#define YYMAXUTOK
|
467
|
+
#define YYMAXUTOK 300
|
461
468
|
|
462
469
|
#define YYTRANSLATE(YYX) \
|
463
470
|
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
|
@@ -494,7 +501,8 @@ static const yytype_uint8 yytranslate[] =
|
|
494
501
|
5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
|
495
502
|
15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
|
496
503
|
25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
|
497
|
-
35, 36, 37, 38, 39, 40, 41, 42, 43
|
504
|
+
35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
|
505
|
+
45
|
498
506
|
};
|
499
507
|
|
500
508
|
#if YYDEBUG
|
@@ -507,41 +515,43 @@ static const yytype_uint8 yyprhs[] =
|
|
507
515
|
42, 45, 49, 51, 54, 57, 61, 63, 66, 68,
|
508
516
|
70, 72, 74, 76, 78, 80, 82, 84, 86, 88,
|
509
517
|
90, 92, 94, 96, 98, 100, 102, 104, 106, 108,
|
510
|
-
110, 112,
|
511
|
-
130, 132, 134,
|
518
|
+
110, 112, 114, 116, 117, 120, 122, 124, 126, 128,
|
519
|
+
130, 132, 134, 136, 138, 139, 144, 148, 149, 154,
|
520
|
+
155
|
512
521
|
};
|
513
522
|
|
514
523
|
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
|
515
524
|
static const yytype_int8 yyrhs[] =
|
516
525
|
{
|
517
|
-
|
518
|
-
-1,
|
519
|
-
-1, -1, -1,
|
520
|
-
|
521
|
-
|
522
|
-
-1,
|
523
|
-
-1,
|
524
|
-
8, -1,
|
525
|
-
5, -1,
|
526
|
-
|
527
|
-
15, -1, 16, -1,
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
-1,
|
526
|
+
47, 0, -1, -1, 48, 47, -1, 69, -1, 57,
|
527
|
+
-1, 62, -1, 63, -1, 64, -1, 65, -1, 66,
|
528
|
+
-1, -1, -1, 49, 53, 50, 48, -1, -1, -1,
|
529
|
+
51, 55, 52, 48, -1, 70, -1, 54, -1, 53,
|
530
|
+
54, -1, 68, 57, -1, 68, 57, 31, -1, 56,
|
531
|
+
-1, 55, 56, -1, 67, 57, -1, 67, 57, 31,
|
532
|
+
-1, 58, -1, 58, 57, -1, 60, -1, 59, -1,
|
533
|
+
8, -1, 21, -1, 22, -1, 4, -1, 42, -1,
|
534
|
+
5, -1, 43, -1, 6, -1, 7, -1, 29, -1,
|
535
|
+
44, -1, 45, -1, 9, -1, 11, -1, 12, -1,
|
536
|
+
15, -1, 16, -1, 17, -1, 18, -1, 13, -1,
|
537
|
+
14, -1, 19, -1, 20, -1, -1, 61, 60, -1,
|
538
|
+
3, -1, 24, -1, 25, -1, 26, -1, 27, -1,
|
539
|
+
28, -1, 32, -1, 33, -1, 31, -1, -1, 34,
|
540
|
+
71, 60, 35, -1, 40, 60, 41, -1, -1, 36,
|
541
|
+
72, 60, 37, -1, -1, 38, 73, 60, 39, -1
|
533
542
|
};
|
534
543
|
|
535
544
|
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
|
536
545
|
static const yytype_uint8 yyrline[] =
|
537
546
|
{
|
538
|
-
0,
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
547
|
+
0, 93, 93, 94, 97, 98, 99, 100, 101, 102,
|
548
|
+
103, 104, 104, 104, 105, 105, 105, 106, 108, 109,
|
549
|
+
111, 112, 114, 115, 117, 118, 120, 121, 123, 124,
|
550
|
+
125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
|
551
|
+
135, 136, 138, 139, 140, 141, 142, 143, 144, 145,
|
552
|
+
146, 147, 148, 150, 151, 153, 160, 161, 162, 163,
|
553
|
+
164, 166, 167, 168, 171, 171, 172, 173, 173, 174,
|
554
|
+
174
|
545
555
|
};
|
546
556
|
#endif
|
547
557
|
|
@@ -553,9 +563,10 @@ static const char *const yytname[] =
|
|
553
563
|
"$end", "error", "$undefined", "T_CHAR", "BOLD_START", "ITALIC_START",
|
554
564
|
"BOLD_ITALIC_START", "ITALIC_BOLD_START", "T_WORD", "TICKET_LINK",
|
555
565
|
"LINK", "SVN_REVISION_LINK", "GIT_REVISION_LINK", "WIKI_LINK",
|
556
|
-
"ANCHOR_LINK", "
|
557
|
-
"
|
558
|
-
"
|
566
|
+
"ANCHOR_LINK", "SVN_N_REVISION_LINK", "GIT_N_REVISION_LINK",
|
567
|
+
"URL_WITH_PROTO_LINK", "URL_WITHOUT_PROTO_LINK", "FILE_LINK",
|
568
|
+
"IMAGE_LINK", "URL", "EMAIL", "UL", "H1", "H2", "H3", "H4", "H5",
|
569
|
+
"INLINE_CODE", "SPACE", "BR", "OLI", "ULI", "PRE_CODE_START",
|
559
570
|
"PRE_CODE_END", "PRE_START", "PRE_END", "CODE_START", "CODE_END",
|
560
571
|
"NOTEXTILE_START", "NOTEXTILE_END", "BOLD_END", "ITALIC_END",
|
561
572
|
"REVERT_BOLD", "REVERT_ITALIC", "$accept", "text", "textitem", "$@1",
|
@@ -574,20 +585,21 @@ static const yytype_uint16 yytoknum[] =
|
|
574
585
|
265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
|
575
586
|
275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
|
576
587
|
285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
|
577
|
-
295, 296, 297, 298
|
588
|
+
295, 296, 297, 298, 299, 300
|
578
589
|
};
|
579
590
|
# endif
|
580
591
|
|
581
592
|
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
|
582
593
|
static const yytype_uint8 yyr1[] =
|
583
594
|
{
|
584
|
-
0,
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
66, 67, 69,
|
595
|
+
0, 46, 47, 47, 48, 48, 48, 48, 48, 48,
|
596
|
+
48, 49, 50, 48, 51, 52, 48, 48, 53, 53,
|
597
|
+
54, 54, 55, 55, 56, 56, 57, 57, 58, 58,
|
598
|
+
58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
|
599
|
+
58, 58, 59, 59, 59, 59, 59, 59, 59, 59,
|
600
|
+
59, 59, 59, 60, 60, 61, 62, 63, 64, 65,
|
601
|
+
66, 67, 68, 69, 71, 70, 70, 72, 70, 73,
|
602
|
+
70
|
591
603
|
};
|
592
604
|
|
593
605
|
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
|
@@ -598,8 +610,9 @@ static const yytype_uint8 yyr2[] =
|
|
598
610
|
2, 3, 1, 2, 2, 3, 1, 2, 1, 1,
|
599
611
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
600
612
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
601
|
-
1,
|
602
|
-
1, 1, 0, 4, 3, 0, 4, 0,
|
613
|
+
1, 1, 1, 0, 2, 1, 1, 1, 1, 1,
|
614
|
+
1, 1, 1, 1, 0, 4, 3, 0, 4, 0,
|
615
|
+
4
|
603
616
|
};
|
604
617
|
|
605
618
|
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
|
@@ -607,23 +620,23 @@ static const yytype_uint8 yyr2[] =
|
|
607
620
|
means the default is an error. */
|
608
621
|
static const yytype_uint8 yydefact[] =
|
609
622
|
{
|
610
|
-
2,
|
611
|
-
|
612
|
-
56, 57, 58,
|
613
|
-
36, 40, 41, 0, 2, 0, 0, 5,
|
614
|
-
28,
|
615
|
-
|
616
|
-
15, 22,
|
617
|
-
19, 20, 11, 23, 24,
|
618
|
-
16, 25
|
623
|
+
2, 55, 33, 35, 37, 38, 30, 42, 43, 44,
|
624
|
+
49, 50, 45, 46, 47, 48, 51, 52, 31, 32,
|
625
|
+
56, 57, 58, 59, 60, 39, 63, 64, 67, 69,
|
626
|
+
53, 34, 36, 40, 41, 0, 2, 0, 0, 5,
|
627
|
+
26, 29, 28, 53, 6, 7, 8, 9, 10, 4,
|
628
|
+
17, 53, 53, 53, 0, 1, 3, 62, 12, 18,
|
629
|
+
53, 61, 15, 22, 53, 27, 54, 0, 0, 0,
|
630
|
+
66, 11, 19, 20, 11, 23, 24, 65, 68, 70,
|
631
|
+
13, 21, 16, 25
|
619
632
|
};
|
620
633
|
|
621
634
|
/* YYDEFGOTO[NTERM-NUM]. */
|
622
635
|
static const yytype_int8 yydefgoto[] =
|
623
636
|
{
|
624
|
-
-1,
|
625
|
-
|
626
|
-
|
637
|
+
-1, 35, 36, 37, 71, 38, 74, 58, 59, 62,
|
638
|
+
63, 39, 40, 41, 42, 43, 44, 45, 46, 47,
|
639
|
+
48, 64, 60, 49, 50, 51, 52, 53
|
627
640
|
};
|
628
641
|
|
629
642
|
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
|
@@ -631,22 +644,22 @@ static const yytype_int8 yydefgoto[] =
|
|
631
644
|
#define YYPACT_NINF -42
|
632
645
|
static const yytype_int8 yypact[] =
|
633
646
|
{
|
634
|
-
|
647
|
+
43, -42, -42, -42, -42, -42, -42, -42, -42, -42,
|
635
648
|
-42, -42, -42, -42, -42, -42, -42, -42, -42, -42,
|
636
|
-
-42, -42, -42, -42, -42, -42, -42, -42,
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
-9, -42,
|
641
|
-
-42, 6, 0, -42, 10, -42, -42, -42,
|
642
|
-
-42, -42
|
649
|
+
-42, -42, -42, -42, -42, -42, -42, -42, -42, -42,
|
650
|
+
-2, -42, -42, -42, -42, 2, 43, -23, -9, -42,
|
651
|
+
86, -42, -42, -2, -42, -42, -42, -42, -42, -42,
|
652
|
+
-42, -2, -2, -2, -6, -42, -42, -42, -23, -42,
|
653
|
+
86, -42, -9, -42, 86, -42, -42, 4, 16, 27,
|
654
|
+
-42, 0, -42, 6, 0, -42, 10, -42, -42, -42,
|
655
|
+
-42, -42, -42, -42
|
643
656
|
};
|
644
657
|
|
645
658
|
/* YYPGOTO[NTERM-NUM]. */
|
646
659
|
static const yytype_int8 yypgoto[] =
|
647
660
|
{
|
648
|
-
-42,
|
649
|
-
|
661
|
+
-42, 37, -41, -42, -42, -42, -42, -42, 20, -42,
|
662
|
+
18, 56, -42, -42, 81, -42, -42, -42, -42, -42,
|
650
663
|
-42, -42, -42, -42, -42, -42, -42, -42
|
651
664
|
};
|
652
665
|
|
@@ -654,39 +667,41 @@ static const yytype_int8 yypgoto[] =
|
|
654
667
|
positive, shift that token. If negative, reduce the rule which
|
655
668
|
number is the opposite. If zero, do what YYDEFACT says.
|
656
669
|
If YYTABLE_NINF, syntax error. */
|
657
|
-
#define YYTABLE_NINF -
|
670
|
+
#define YYTABLE_NINF -54
|
658
671
|
static const yytype_int8 yytable[] =
|
659
672
|
{
|
660
|
-
-
|
661
|
-
|
662
|
-
17,
|
663
|
-
|
664
|
-
|
665
|
-
7,
|
666
|
-
16, 17,
|
667
|
-
24,
|
668
|
-
|
669
|
-
6, 7,
|
670
|
-
15, 16, 17,
|
671
|
-
0,
|
672
|
-
|
673
|
+
-53, 1, 55, 1, 2, 3, 4, 5, 6, 7,
|
674
|
+
57, 8, 9, 10, 11, 12, 13, 14, 15, 16,
|
675
|
+
17, 18, 19, 61, 20, 21, 22, 23, 24, 25,
|
676
|
+
80, 26, -14, 82, 27, 70, 28, 81, 29, 77,
|
677
|
+
30, 83, 31, 32, 33, 34, 1, 2, 3, 4,
|
678
|
+
5, 6, 7, 78, 8, 9, 10, 11, 12, 13,
|
679
|
+
14, 15, 16, 17, 18, 19, 79, 20, 21, 22,
|
680
|
+
23, 24, 25, 56, 26, -14, -11, 27, 72, 28,
|
681
|
+
75, 29, 0, 30, 0, 31, 32, 33, 34, 1,
|
682
|
+
2, 3, 4, 5, 6, 7, 65, 8, 9, 10,
|
683
|
+
11, 12, 13, 14, 15, 16, 17, 18, 19, 0,
|
684
|
+
0, 54, 0, 0, 0, 25, 73, 0, 0, 0,
|
685
|
+
76, 0, 0, 0, 66, 0, 0, 0, 31, 32,
|
686
|
+
33, 34, 67, 68, 69
|
673
687
|
};
|
674
688
|
|
675
689
|
static const yytype_int8 yycheck[] =
|
676
690
|
{
|
677
691
|
0, 3, 0, 3, 4, 5, 6, 7, 8, 9,
|
678
|
-
|
679
|
-
20,
|
680
|
-
|
681
|
-
40,
|
682
|
-
9,
|
683
|
-
19, 20,
|
684
|
-
29,
|
685
|
-
|
686
|
-
8, 9,
|
687
|
-
|
688
|
-
-1,
|
689
|
-
-1, -1,
|
692
|
+
33, 11, 12, 13, 14, 15, 16, 17, 18, 19,
|
693
|
+
20, 21, 22, 32, 24, 25, 26, 27, 28, 29,
|
694
|
+
71, 31, 32, 74, 34, 41, 36, 31, 38, 35,
|
695
|
+
40, 31, 42, 43, 44, 45, 3, 4, 5, 6,
|
696
|
+
7, 8, 9, 37, 11, 12, 13, 14, 15, 16,
|
697
|
+
17, 18, 19, 20, 21, 22, 39, 24, 25, 26,
|
698
|
+
27, 28, 29, 36, 31, 32, 33, 34, 58, 36,
|
699
|
+
62, 38, -1, 40, -1, 42, 43, 44, 45, 3,
|
700
|
+
4, 5, 6, 7, 8, 9, 40, 11, 12, 13,
|
701
|
+
14, 15, 16, 17, 18, 19, 20, 21, 22, -1,
|
702
|
+
-1, 30, -1, -1, -1, 29, 60, -1, -1, -1,
|
703
|
+
64, -1, -1, -1, 43, -1, -1, -1, 42, 43,
|
704
|
+
44, 45, 51, 52, 53
|
690
705
|
};
|
691
706
|
|
692
707
|
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
|
@@ -694,14 +709,14 @@ static const yytype_int8 yycheck[] =
|
|
694
709
|
static const yytype_uint8 yystos[] =
|
695
710
|
{
|
696
711
|
0, 3, 4, 5, 6, 7, 8, 9, 11, 12,
|
697
|
-
13, 14, 15, 16, 17, 18, 19, 20,
|
698
|
-
24, 25, 26, 27, 29,
|
699
|
-
|
700
|
-
58, 59, 60, 61, 62, 63, 64,
|
701
|
-
70, 71,
|
702
|
-
|
703
|
-
|
704
|
-
|
712
|
+
13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
|
713
|
+
24, 25, 26, 27, 28, 29, 31, 34, 36, 38,
|
714
|
+
40, 42, 43, 44, 45, 47, 48, 49, 51, 57,
|
715
|
+
58, 59, 60, 61, 62, 63, 64, 65, 66, 69,
|
716
|
+
70, 71, 72, 73, 60, 0, 47, 33, 53, 54,
|
717
|
+
68, 32, 55, 56, 67, 57, 60, 60, 60, 60,
|
718
|
+
41, 50, 54, 57, 52, 56, 57, 35, 37, 39,
|
719
|
+
48, 31, 48, 31
|
705
720
|
};
|
706
721
|
|
707
722
|
#define yyerrok (yyerrstatus = 0)
|
@@ -1515,350 +1530,364 @@ yyreduce:
|
|
1515
1530
|
case 6:
|
1516
1531
|
|
1517
1532
|
/* Line 1455 of yacc.c */
|
1518
|
-
#line
|
1533
|
+
#line 99 "parser.y"
|
1519
1534
|
{concat("</h1>",5);}
|
1520
1535
|
break;
|
1521
1536
|
|
1522
1537
|
case 7:
|
1523
1538
|
|
1524
1539
|
/* Line 1455 of yacc.c */
|
1525
|
-
#line
|
1540
|
+
#line 100 "parser.y"
|
1526
1541
|
{concat("</h2>",5);}
|
1527
1542
|
break;
|
1528
1543
|
|
1529
1544
|
case 8:
|
1530
1545
|
|
1531
1546
|
/* Line 1455 of yacc.c */
|
1532
|
-
#line
|
1547
|
+
#line 101 "parser.y"
|
1533
1548
|
{concat("</h3>",5);}
|
1534
1549
|
break;
|
1535
1550
|
|
1536
1551
|
case 9:
|
1537
1552
|
|
1538
1553
|
/* Line 1455 of yacc.c */
|
1539
|
-
#line
|
1554
|
+
#line 102 "parser.y"
|
1540
1555
|
{concat("</h4>",5);}
|
1541
1556
|
break;
|
1542
1557
|
|
1543
1558
|
case 10:
|
1544
1559
|
|
1545
1560
|
/* Line 1455 of yacc.c */
|
1546
|
-
#line
|
1561
|
+
#line 103 "parser.y"
|
1547
1562
|
{concat("</h5>",5);}
|
1548
1563
|
break;
|
1549
1564
|
|
1550
1565
|
case 11:
|
1551
1566
|
|
1552
1567
|
/* Line 1455 of yacc.c */
|
1553
|
-
#line
|
1568
|
+
#line 104 "parser.y"
|
1554
1569
|
{concat("<ul>",4);}
|
1555
1570
|
break;
|
1556
1571
|
|
1557
1572
|
case 12:
|
1558
1573
|
|
1559
1574
|
/* Line 1455 of yacc.c */
|
1560
|
-
#line
|
1575
|
+
#line 104 "parser.y"
|
1561
1576
|
{concat("</ul>",5);}
|
1562
1577
|
break;
|
1563
1578
|
|
1564
1579
|
case 14:
|
1565
1580
|
|
1566
1581
|
/* Line 1455 of yacc.c */
|
1567
|
-
#line
|
1582
|
+
#line 105 "parser.y"
|
1568
1583
|
{concat("<ol>",4);}
|
1569
1584
|
break;
|
1570
1585
|
|
1571
1586
|
case 15:
|
1572
1587
|
|
1573
1588
|
/* Line 1455 of yacc.c */
|
1574
|
-
#line
|
1589
|
+
#line 105 "parser.y"
|
1575
1590
|
{concat("</ol>",5);}
|
1576
1591
|
break;
|
1577
1592
|
|
1578
1593
|
case 18:
|
1579
1594
|
|
1580
1595
|
/* Line 1455 of yacc.c */
|
1581
|
-
#line
|
1596
|
+
#line 108 "parser.y"
|
1582
1597
|
{concat("</li>",5);}
|
1583
1598
|
break;
|
1584
1599
|
|
1585
1600
|
case 19:
|
1586
1601
|
|
1587
1602
|
/* Line 1455 of yacc.c */
|
1588
|
-
#line
|
1603
|
+
#line 109 "parser.y"
|
1589
1604
|
{concat("</li>",5);}
|
1590
1605
|
break;
|
1591
1606
|
|
1592
1607
|
case 22:
|
1593
1608
|
|
1594
1609
|
/* Line 1455 of yacc.c */
|
1595
|
-
#line
|
1610
|
+
#line 114 "parser.y"
|
1596
1611
|
{concat("</li>",5);}
|
1597
1612
|
break;
|
1598
1613
|
|
1599
1614
|
case 23:
|
1600
1615
|
|
1601
1616
|
/* Line 1455 of yacc.c */
|
1602
|
-
#line
|
1617
|
+
#line 115 "parser.y"
|
1603
1618
|
{concat("</li>",5);}
|
1604
1619
|
break;
|
1605
1620
|
|
1606
1621
|
case 30:
|
1607
1622
|
|
1608
1623
|
/* Line 1455 of yacc.c */
|
1609
|
-
#line
|
1624
|
+
#line 125 "parser.y"
|
1610
1625
|
{concat2((yyvsp[(1) - (1)].svalue));}
|
1611
1626
|
break;
|
1612
1627
|
|
1613
1628
|
case 31:
|
1614
1629
|
|
1615
1630
|
/* Line 1455 of yacc.c */
|
1616
|
-
#line
|
1631
|
+
#line 126 "parser.y"
|
1617
1632
|
{process_url((yyvsp[(1) - (1)].svalue));}
|
1618
1633
|
break;
|
1619
1634
|
|
1620
1635
|
case 32:
|
1621
1636
|
|
1622
1637
|
/* Line 1455 of yacc.c */
|
1623
|
-
#line
|
1638
|
+
#line 127 "parser.y"
|
1624
1639
|
{process_email((yyvsp[(1) - (1)].svalue));}
|
1625
1640
|
break;
|
1626
1641
|
|
1627
1642
|
case 33:
|
1628
1643
|
|
1629
1644
|
/* Line 1455 of yacc.c */
|
1630
|
-
#line
|
1645
|
+
#line 128 "parser.y"
|
1631
1646
|
{(yyvsp[(1) - (1)].ivalue) ? concat(" <strong>",9) : concat("<strong>",8);}
|
1632
1647
|
break;
|
1633
1648
|
|
1634
1649
|
case 34:
|
1635
1650
|
|
1636
1651
|
/* Line 1455 of yacc.c */
|
1637
|
-
#line
|
1652
|
+
#line 129 "parser.y"
|
1638
1653
|
{concat("</strong>",9);}
|
1639
1654
|
break;
|
1640
1655
|
|
1641
1656
|
case 35:
|
1642
1657
|
|
1643
1658
|
/* Line 1455 of yacc.c */
|
1644
|
-
#line
|
1659
|
+
#line 130 "parser.y"
|
1645
1660
|
{(yyvsp[(1) - (1)].ivalue) ? concat(" <em>",5) : concat("<em>",4);}
|
1646
1661
|
break;
|
1647
1662
|
|
1648
1663
|
case 36:
|
1649
1664
|
|
1650
1665
|
/* Line 1455 of yacc.c */
|
1651
|
-
#line
|
1666
|
+
#line 131 "parser.y"
|
1652
1667
|
{concat("</em>",5);}
|
1653
1668
|
break;
|
1654
1669
|
|
1655
1670
|
case 37:
|
1656
1671
|
|
1657
1672
|
/* Line 1455 of yacc.c */
|
1658
|
-
#line
|
1673
|
+
#line 132 "parser.y"
|
1659
1674
|
{(yyvsp[(1) - (1)].ivalue) ? concat(" <strong><em>",13) : concat("<strong><em>",12);}
|
1660
1675
|
break;
|
1661
1676
|
|
1662
1677
|
case 38:
|
1663
1678
|
|
1664
1679
|
/* Line 1455 of yacc.c */
|
1665
|
-
#line
|
1680
|
+
#line 133 "parser.y"
|
1666
1681
|
{(yyvsp[(1) - (1)].ivalue) ? concat(" <em><strong>",13) : concat("<em><strong>",12);}
|
1667
1682
|
break;
|
1668
1683
|
|
1669
1684
|
case 39:
|
1670
1685
|
|
1671
1686
|
/* Line 1455 of yacc.c */
|
1672
|
-
#line
|
1687
|
+
#line 134 "parser.y"
|
1673
1688
|
{process_inline_code((yyvsp[(1) - (1)].svalue));}
|
1674
1689
|
break;
|
1675
1690
|
|
1676
1691
|
case 40:
|
1677
1692
|
|
1678
1693
|
/* Line 1455 of yacc.c */
|
1679
|
-
#line
|
1694
|
+
#line 135 "parser.y"
|
1680
1695
|
{revert_bold();}
|
1681
1696
|
break;
|
1682
1697
|
|
1683
1698
|
case 41:
|
1684
1699
|
|
1685
1700
|
/* Line 1455 of yacc.c */
|
1686
|
-
#line
|
1701
|
+
#line 136 "parser.y"
|
1687
1702
|
{revert_italic();}
|
1688
1703
|
break;
|
1689
1704
|
|
1690
1705
|
case 42:
|
1691
1706
|
|
1692
1707
|
/* Line 1455 of yacc.c */
|
1693
|
-
#line
|
1708
|
+
#line 138 "parser.y"
|
1694
1709
|
{process_ticket_link((yyvsp[(1) - (1)].svalue));}
|
1695
1710
|
break;
|
1696
1711
|
|
1697
1712
|
case 43:
|
1698
1713
|
|
1699
1714
|
/* Line 1455 of yacc.c */
|
1700
|
-
#line
|
1701
|
-
{process_svn_link((yyvsp[(1) - (1)].svalue));}
|
1715
|
+
#line 139 "parser.y"
|
1716
|
+
{process_svn_link((yyvsp[(1) - (1)].svalue),0);}
|
1702
1717
|
break;
|
1703
1718
|
|
1704
1719
|
case 44:
|
1705
1720
|
|
1706
1721
|
/* Line 1455 of yacc.c */
|
1707
|
-
#line
|
1708
|
-
{process_git_link((yyvsp[(1) - (1)].svalue));}
|
1722
|
+
#line 140 "parser.y"
|
1723
|
+
{process_git_link((yyvsp[(1) - (1)].svalue),0);}
|
1709
1724
|
break;
|
1710
1725
|
|
1711
1726
|
case 45:
|
1712
1727
|
|
1713
1728
|
/* Line 1455 of yacc.c */
|
1714
|
-
#line
|
1715
|
-
{
|
1729
|
+
#line 141 "parser.y"
|
1730
|
+
{process_svn_link((yyvsp[(1) - (1)].svalue),1);}
|
1716
1731
|
break;
|
1717
1732
|
|
1718
1733
|
case 46:
|
1719
1734
|
|
1720
1735
|
/* Line 1455 of yacc.c */
|
1721
|
-
#line
|
1722
|
-
{
|
1736
|
+
#line 142 "parser.y"
|
1737
|
+
{process_git_link((yyvsp[(1) - (1)].svalue),1);}
|
1723
1738
|
break;
|
1724
1739
|
|
1725
1740
|
case 47:
|
1726
1741
|
|
1727
1742
|
/* Line 1455 of yacc.c */
|
1728
|
-
#line
|
1729
|
-
{
|
1743
|
+
#line 143 "parser.y"
|
1744
|
+
{process_url_link((yyvsp[(1) - (1)].svalue),NULL);}
|
1730
1745
|
break;
|
1731
1746
|
|
1732
1747
|
case 48:
|
1733
1748
|
|
1734
1749
|
/* Line 1455 of yacc.c */
|
1735
|
-
#line
|
1736
|
-
{
|
1750
|
+
#line 144 "parser.y"
|
1751
|
+
{process_url_link((yyvsp[(1) - (1)].svalue),"http://");}
|
1737
1752
|
break;
|
1738
1753
|
|
1739
1754
|
case 49:
|
1740
1755
|
|
1741
1756
|
/* Line 1455 of yacc.c */
|
1742
|
-
#line
|
1743
|
-
{
|
1757
|
+
#line 145 "parser.y"
|
1758
|
+
{process_wiki_link((yyvsp[(1) - (1)].svalue));}
|
1744
1759
|
break;
|
1745
1760
|
|
1746
1761
|
case 50:
|
1747
1762
|
|
1748
1763
|
/* Line 1455 of yacc.c */
|
1749
|
-
#line
|
1764
|
+
#line 146 "parser.y"
|
1765
|
+
{process_anchor_link((yyvsp[(1) - (1)].svalue));}
|
1766
|
+
break;
|
1767
|
+
|
1768
|
+
case 51:
|
1769
|
+
|
1770
|
+
/* Line 1455 of yacc.c */
|
1771
|
+
#line 147 "parser.y"
|
1772
|
+
{process_file_link((yyvsp[(1) - (1)].svalue));}
|
1773
|
+
break;
|
1774
|
+
|
1775
|
+
case 52:
|
1776
|
+
|
1777
|
+
/* Line 1455 of yacc.c */
|
1778
|
+
#line 148 "parser.y"
|
1750
1779
|
{process_image_link((yyvsp[(1) - (1)].svalue));}
|
1751
1780
|
break;
|
1752
1781
|
|
1753
|
-
case
|
1782
|
+
case 55:
|
1754
1783
|
|
1755
1784
|
/* Line 1455 of yacc.c */
|
1756
|
-
#line
|
1785
|
+
#line 153 "parser.y"
|
1757
1786
|
{concat_escaped_char((yyvsp[(1) - (1)].ivalue));}
|
1758
1787
|
break;
|
1759
1788
|
|
1760
|
-
case
|
1789
|
+
case 56:
|
1761
1790
|
|
1762
1791
|
/* Line 1455 of yacc.c */
|
1763
|
-
#line
|
1792
|
+
#line 160 "parser.y"
|
1764
1793
|
{concat("<h1 id=\"",8); process_header((yyvsp[(1) - (1)].svalue));}
|
1765
1794
|
break;
|
1766
1795
|
|
1767
|
-
case
|
1796
|
+
case 57:
|
1768
1797
|
|
1769
1798
|
/* Line 1455 of yacc.c */
|
1770
|
-
#line
|
1799
|
+
#line 161 "parser.y"
|
1771
1800
|
{concat("<h2 id=\"",8); process_header((yyvsp[(1) - (1)].svalue));}
|
1772
1801
|
break;
|
1773
1802
|
|
1774
|
-
case
|
1803
|
+
case 58:
|
1775
1804
|
|
1776
1805
|
/* Line 1455 of yacc.c */
|
1777
|
-
#line
|
1806
|
+
#line 162 "parser.y"
|
1778
1807
|
{concat("<h3 id=\"",8); process_header((yyvsp[(1) - (1)].svalue));}
|
1779
1808
|
break;
|
1780
1809
|
|
1781
|
-
case
|
1810
|
+
case 59:
|
1782
1811
|
|
1783
1812
|
/* Line 1455 of yacc.c */
|
1784
|
-
#line
|
1813
|
+
#line 163 "parser.y"
|
1785
1814
|
{concat("<h4 id=\"",8); process_header((yyvsp[(1) - (1)].svalue));}
|
1786
1815
|
break;
|
1787
1816
|
|
1788
|
-
case
|
1817
|
+
case 60:
|
1789
1818
|
|
1790
1819
|
/* Line 1455 of yacc.c */
|
1791
|
-
#line
|
1820
|
+
#line 164 "parser.y"
|
1792
1821
|
{concat("<h5 id=\"",8); process_header((yyvsp[(1) - (1)].svalue));}
|
1793
1822
|
break;
|
1794
1823
|
|
1795
|
-
case
|
1824
|
+
case 61:
|
1796
1825
|
|
1797
1826
|
/* Line 1455 of yacc.c */
|
1798
|
-
#line
|
1827
|
+
#line 166 "parser.y"
|
1799
1828
|
{concat("<li>",4);}
|
1800
1829
|
break;
|
1801
1830
|
|
1802
|
-
case
|
1831
|
+
case 62:
|
1803
1832
|
|
1804
1833
|
/* Line 1455 of yacc.c */
|
1805
|
-
#line
|
1834
|
+
#line 167 "parser.y"
|
1806
1835
|
{concat("<li>",4);}
|
1807
1836
|
break;
|
1808
1837
|
|
1809
|
-
case
|
1838
|
+
case 63:
|
1810
1839
|
|
1811
1840
|
/* Line 1455 of yacc.c */
|
1812
|
-
#line
|
1841
|
+
#line 168 "parser.y"
|
1813
1842
|
{concat("<br />",6);}
|
1814
1843
|
break;
|
1815
1844
|
|
1816
|
-
case
|
1845
|
+
case 64:
|
1817
1846
|
|
1818
1847
|
/* Line 1455 of yacc.c */
|
1819
|
-
#line
|
1848
|
+
#line 171 "parser.y"
|
1820
1849
|
{concat("<pre><code>",11);}
|
1821
1850
|
break;
|
1822
1851
|
|
1823
|
-
case
|
1852
|
+
case 65:
|
1824
1853
|
|
1825
1854
|
/* Line 1455 of yacc.c */
|
1826
|
-
#line
|
1855
|
+
#line 171 "parser.y"
|
1827
1856
|
{concat("</code></pre>",13);}
|
1828
1857
|
break;
|
1829
1858
|
|
1830
|
-
case
|
1859
|
+
case 67:
|
1831
1860
|
|
1832
1861
|
/* Line 1455 of yacc.c */
|
1833
|
-
#line
|
1862
|
+
#line 173 "parser.y"
|
1834
1863
|
{concat("<pre>",5);}
|
1835
1864
|
break;
|
1836
1865
|
|
1837
|
-
case
|
1866
|
+
case 68:
|
1838
1867
|
|
1839
1868
|
/* Line 1455 of yacc.c */
|
1840
|
-
#line
|
1869
|
+
#line 173 "parser.y"
|
1841
1870
|
{concat("</pre>",6);}
|
1842
1871
|
break;
|
1843
1872
|
|
1844
|
-
case
|
1873
|
+
case 69:
|
1845
1874
|
|
1846
1875
|
/* Line 1455 of yacc.c */
|
1847
|
-
#line
|
1876
|
+
#line 174 "parser.y"
|
1848
1877
|
{concat("<code>",6);}
|
1849
1878
|
break;
|
1850
1879
|
|
1851
|
-
case
|
1880
|
+
case 70:
|
1852
1881
|
|
1853
1882
|
/* Line 1455 of yacc.c */
|
1854
|
-
#line
|
1883
|
+
#line 174 "parser.y"
|
1855
1884
|
{concat("</code>",7);}
|
1856
1885
|
break;
|
1857
1886
|
|
1858
1887
|
|
1859
1888
|
|
1860
1889
|
/* Line 1455 of yacc.c */
|
1861
|
-
#line
|
1890
|
+
#line 1891 "parser.tab.c"
|
1862
1891
|
default: break;
|
1863
1892
|
}
|
1864
1893
|
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
|
@@ -2070,7 +2099,7 @@ yyreturn:
|
|
2070
2099
|
|
2071
2100
|
|
2072
2101
|
/* Line 1675 of yacc.c */
|
2073
|
-
#line
|
2102
|
+
#line 178 "parser.y"
|
2074
2103
|
|
2075
2104
|
|
2076
2105
|
concat_hex_char(char c){
|
@@ -2190,29 +2219,72 @@ process_url_link(const char*target,const char* proto){
|
|
2190
2219
|
process_link_tail(target,NULL,proto);
|
2191
2220
|
}
|
2192
2221
|
|
2193
|
-
|
2222
|
+
concat_site_url(){
|
2223
|
+
if( site_url && site_url_len > 0 ){
|
2224
|
+
concat(site_url, site_url_len);
|
2225
|
+
}
|
2226
|
+
}
|
2227
|
+
|
2228
|
+
process_svn_link(const char*target, int numbered_repo){
|
2194
2229
|
const char *c;
|
2195
|
-
|
2230
|
+
// can use sprintf here.. but I think it's a way slower than raw concat
|
2231
|
+
concat("<a href=\"",9);
|
2232
|
+
concat_site_url();
|
2233
|
+
concat("/code/",6);
|
2196
2234
|
concat(space_name,space_name_len);
|
2197
|
-
|
2235
|
+
if( numbered_repo ){
|
2236
|
+
concat("/subversion-",12);
|
2237
|
+
while( *target >= '0' && *target <= '9' ) concat_raw_char(*target++);
|
2238
|
+
while( *target == ':' ) target++;
|
2239
|
+
concat("/changesets/",12);
|
2240
|
+
} else {
|
2241
|
+
concat("/subversion/changesets/",23);
|
2242
|
+
}
|
2198
2243
|
for(c=target; *c && *c!=']' && *c!='|'; c++) concat_raw_char(*c);
|
2199
2244
|
process_link_tail(target,NULL,"revision:");
|
2200
2245
|
}
|
2201
2246
|
|
2202
|
-
|
2247
|
+
int concat_custom_git_url(){
|
2203
2248
|
const char *c;
|
2204
|
-
|
2205
|
-
|
2206
|
-
|
2249
|
+
if( git_url && (c = StringValuePtr(git_url)) ){
|
2250
|
+
size_t l = strlen(c);
|
2251
|
+
if( l>0 ){
|
2252
|
+
concat2(c);
|
2253
|
+
return 1;
|
2254
|
+
}
|
2255
|
+
}
|
2256
|
+
return 0;
|
2257
|
+
}
|
2258
|
+
|
2259
|
+
process_git_link(const char*target, int numbered_repo){
|
2260
|
+
const char *c;
|
2261
|
+
// can use sprintf here.. but I think it's a way slower than raw concat
|
2262
|
+
concat("<a href=\"",9);
|
2263
|
+
if( !concat_custom_git_url() ){
|
2264
|
+
concat_site_url();
|
2265
|
+
concat("/code/",6);
|
2266
|
+
concat(space_name,space_name_len);
|
2267
|
+
if( numbered_repo ){
|
2268
|
+
concat("/git-",5);
|
2269
|
+
while( *target >= '0' && *target <= '9' ) concat_raw_char(*target++);
|
2270
|
+
while( *target == ':' ) target++;
|
2271
|
+
concat("/changesets/",12);
|
2272
|
+
} else {
|
2273
|
+
concat("/git/changesets/",16);
|
2274
|
+
}
|
2275
|
+
}
|
2207
2276
|
for(c=target; *c && *c!=']' && *c!='|'; c++) concat_raw_char(*c);
|
2208
2277
|
process_link_tail(target,NULL,"revision:");
|
2209
2278
|
}
|
2210
2279
|
|
2211
2280
|
process_wiki_link(const char*target){
|
2212
2281
|
const char *c;
|
2282
|
+
// can use sprintf here.. but I think it's a way slower than raw concat
|
2213
2283
|
concat("<a class=\"wiki_link\" title=\"",28);
|
2214
2284
|
for(c=target; *c && *c!=']' && *c!='|'; c++) concat_raw_char(*c);
|
2215
|
-
concat("\" href=\"
|
2285
|
+
concat("\" href=\"",8);
|
2286
|
+
concat_site_url();
|
2287
|
+
concat("/wiki/show/",11);
|
2216
2288
|
concat(space_name,space_name_len);
|
2217
2289
|
concat_raw_char('/');
|
2218
2290
|
for(c=target; *c && *c!=']' && *c!='|'; c++) concat_raw_char(*c);
|
@@ -2221,7 +2293,10 @@ process_wiki_link(const char*target){
|
|
2221
2293
|
|
2222
2294
|
process_file_link(const char*target){
|
2223
2295
|
const char *c;
|
2224
|
-
|
2296
|
+
// can use sprintf here.. but I think it's a way slower than raw concat
|
2297
|
+
concat("<a href=\"",9);
|
2298
|
+
concat_site_url();
|
2299
|
+
concat("/spaces/",8);
|
2225
2300
|
concat(space_name,space_name_len);
|
2226
2301
|
concat("/documents/download/",20);
|
2227
2302
|
for(c=target; *c && *c!=']' && *c!='|'; c++) concat_raw_char(*c);
|
@@ -2230,7 +2305,10 @@ process_file_link(const char*target){
|
|
2230
2305
|
|
2231
2306
|
process_image_link(const char*target){
|
2232
2307
|
const char *c, *p;
|
2233
|
-
concat
|
2308
|
+
// can use sprintf here.. but I think it's a way slower than raw concat
|
2309
|
+
concat("<img src=\"",10);
|
2310
|
+
concat_site_url();
|
2311
|
+
concat("/spaces/",8);
|
2234
2312
|
concat(space_name,space_name_len);
|
2235
2313
|
concat("/documents/download/",20);
|
2236
2314
|
for(c=target; *c && *c!=']' && *c!='|'; c++) concat_raw_char(*c);
|
@@ -2246,7 +2324,10 @@ process_image_link(const char*target){
|
|
2246
2324
|
process_ticket_link(const char*ticket_id){
|
2247
2325
|
const char *c;
|
2248
2326
|
while(*ticket_id && (*ticket_id < '0' || *ticket_id > '9') ) ticket_id++;
|
2249
|
-
|
2327
|
+
// can use sprintf here.. but I think it's a way slower than raw concat
|
2328
|
+
concat("<a href=\"",9);
|
2329
|
+
concat_site_url();
|
2330
|
+
concat("/spaces/",8);
|
2250
2331
|
concat(space_name,space_name_len);
|
2251
2332
|
concat("/tickets/",9);
|
2252
2333
|
for(c=ticket_id; *c && *c>='0' && *c<='9'; c++) concat_raw_char(*c);
|
@@ -2279,36 +2360,6 @@ concat_raw_char(int c){
|
|
2279
2360
|
*bufptr++ = c;
|
2280
2361
|
}
|
2281
2362
|
|
2282
|
-
/*
|
2283
|
-
concat_escaping_html(const char*what){
|
2284
|
-
char *po = buf + strlen(buf);
|
2285
|
-
const char *pi = what;
|
2286
|
-
|
2287
|
-
for(;*pi;pi++){
|
2288
|
-
switch(*pi){
|
2289
|
-
case '<':
|
2290
|
-
strcpy(po,"<");
|
2291
|
-
po += 4;
|
2292
|
-
break;
|
2293
|
-
case '>':
|
2294
|
-
strcpy(po,">");
|
2295
|
-
po += 4;
|
2296
|
-
break;
|
2297
|
-
case '"':
|
2298
|
-
strcpy(po,""");
|
2299
|
-
po += 6;
|
2300
|
-
break;
|
2301
|
-
case '&':
|
2302
|
-
strcpy(po,"&");
|
2303
|
-
po += 5;
|
2304
|
-
break;
|
2305
|
-
default:
|
2306
|
-
*po++ = *pi;
|
2307
|
-
}
|
2308
|
-
}
|
2309
|
-
*po = 0;
|
2310
|
-
}*/
|
2311
|
-
|
2312
2363
|
process_url(const char*url){
|
2313
2364
|
const char *p;
|
2314
2365
|
|