Introduction
Introduction Statistics Contact Development Disclaimer Help
dolineprefix can now work without newblock - smu - smu - simple markup (Markdow…
git clone git://git.codemadness.org/smu
Log
Files
Refs
README
LICENSE
---
commit f7cd9bb5101e3565f6d78adbe8076b3f5cb798c3
parent 6a94a6b5ec892789d016af8fd6b99701182fd445
Author: [email protected] <[email protected]>
Date: Tue, 1 Jan 2008 20:02:20 +0100
dolineprefix can now work without newblock
Diffstat:
M smu.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/smu.c b/smu.c
@@ -164,9 +164,12 @@ dolineprefix(const char *begin, const char *end, int newbl…
char *buffer;
const char *p;
- if(!newblock)
+ if(newblock)
+ p = begin;
+ else if(*begin == '\n')
+ p = begin + 1;
+ else
return 0;
- p = begin;
for(i = 0; i < LENGTH(lineprefix); i++) {
l = strlen(lineprefix[i].search);
if(end - p < l)
@@ -176,6 +179,8 @@ dolineprefix(const char *begin, const char *end, int newblo…
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;
@@ -330,7 +335,7 @@ doparagraph(const char *begin, const char *end, int newbloc…
return 0;
fputs("<p>\n",stdout);
process(p,q,0);
- fputs("\n</p>\n",stdout);
+ fputs("</p>\n",stdout);
return -(q - begin);
}
You are viewing proxied material from codemadness.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.