diff --git a/main.c b/main.c index 7082e55..41bc582 100644 --- a/main.c +++ b/main.c @@ -277,58 +277,73 @@ dohyperlink(void) { } void build(void) { } - void generate(void) { + +void generate(void) { fprintf(fpto, "\n
\n"); fprintf(fpto, "\n"); fprintf(fpto, ""); + mdt.quote = 1; while (i < len && (txt[i] == '>' || txt[i] == ' ')) i++; } else { fprintf(fpto, ""); + i = 0; } - for (i = 0; i < len; i++) { - - if (txt[i] == '_' && (i == 0 || txt[i-1] != '\\')) { + for (; i < len; i++) { + if (txt[i] == '_' && (i == 0 || txt[i - 1] != '\\')) { doitalic(); - } else if (txt[i] == '!' && (i == 0 || txt[i-1] != '\\')) { + } else if (txt[i] == '!' && (i == 0 || txt[i - 1] != '\\')) { doimage(); - } else if (txt[i] == '[' && (i == 0 || txt[i-1] != '\\')) { + } else if (txt[i] == '[' && (i == 0 || txt[i - 1] != '\\')) { dohyperlink(); - } else if (txt[i] == '`' && (i == 0 || txt[i-1] != '\\')) { + } else if (txt[i] == '`' && (i == 0 || txt[i - 1] != '\\')) { docode(); - } else if (i + 1 < len && txt[i] == '*' && txt[i+1] == '*' && (i == 0 || txt[i-1] != '\\')) { + } else if (i + 1 < len && txt[i] == '*' && txt[i + 1] == '*' && (i == 0 || txt[i - 1] != '\\')) { dobold(); } else { fputc(txt[i], fpto); @@ -349,7 +364,7 @@ void build(void) { } fprintf(fpto, "\n"); - } +} int main(int argc, char *argv[]) { if (argc < 2) {