diff options
| author | gottox@rootkit.lan <gottox@rootkit.lan> | 2008-01-14 13:52:56 +0100 |
|---|---|---|
| committer | gottox@rootkit.lan <gottox@rootkit.lan> | 2008-01-14 13:52:56 +0100 |
| commit | 44bcd35d56ff5bc59e6ef554298efe49b1237b45 (patch) | |
| tree | 1788a5dc27af322123fa7a42372c133c78790b1d | |
| parent | f6967fe5819b82c722fe4270c55f1ea1cb9c7fae (diff) | |
<hr /> is now more proper.
| -rw-r--r-- | smu.c | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -50,8 +50,8 @@ void hprint(const char *begin, const char *end); /* escapes HTML and prints it t void process(const char *begin, const char *end, int isblock); /* Processes range between begin and end. */ -Parser parsers[] = { doreplace, dounderline, dohtml, dolineprefix, dolist, doparagraph, - dogtlt, dosurround, dolink, doshortlink, doamp }; +Parser parsers[] = { dounderline, dohtml, dolineprefix, dolist, doparagraph, + dogtlt, dosurround, dolink, doshortlink, doamp, doreplace }; /* list of parsers */ FILE *source; unsigned int nohtml = 0; @@ -175,12 +175,16 @@ dolineprefix(const char *begin, const char *end, int newblock) { continue; if(strncmp(lineprefix[i].search, p, l)) continue; + if(*begin == '\n') + fputc('\n', stdout); + fputs(lineprefix[i].before, stdout); + if(lineprefix[i].search[l-1] == '\n') { + fputc('\n', stdout); + return l; + } if(!(buffer = malloc(BUFFERSIZE))) eprint("Malloc failed."); buffer[0] = '\0'; - if(*begin == '\n') - fputs("\n", stdout); - fputs(lineprefix[i].before, stdout); for(j = 0, p += l; p < end; p++, j++) { ADDC(buffer, j) = *p; if(*p == '\n' && p + l < end) { |