full build of tcc with itself - doesn't match gcc :o
This commit is contained in:
parent
59b7931165
commit
9c6b9a1450
11 changed files with 250 additions and 44 deletions
17
markdown.c
17
markdown.c
|
@ -19,7 +19,12 @@ static void output_md_text(FILE *out, int *flags, int line_number, const char *t
|
|||
|
||||
for (p = text; *p; ++p) {
|
||||
if ((*flags & FLAG_CODE) && *p != '`') {
|
||||
putc(*p, out);
|
||||
switch (*p) {
|
||||
case '<': fprintf(out, "<"); break;
|
||||
case '>': fprintf(out, ">"); break;
|
||||
case '&': fprintf(out, "&"); break;
|
||||
default: putc(*p, out); break;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
switch (*p) {
|
||||
|
@ -198,10 +203,18 @@ int main(int argc, char **argv) {
|
|||
fprintf(out, "<pre><code>\n");
|
||||
|
||||
while (fgets(line, sizeof line, in)) {
|
||||
char *p;
|
||||
++line_number;
|
||||
if (strncmp(line, "```", 3) == 0)
|
||||
break;
|
||||
fprintf(out, "%s", line);
|
||||
for (p = line; *p; ++p) {
|
||||
switch (*p) {
|
||||
case '<': fprintf(out, "<"); break;
|
||||
case '>': fprintf(out, ">"); break;
|
||||
case '&': fprintf(out, "&"); break;
|
||||
default: fputc(*p, out); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(out, "</code></pre>\n");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue