Nicer output in Makefile; dounderline ends with \n; adding -Werror; dohtml uses newblock; some cleanups

This commit is contained in:
gottox@rootkit.lan 2007-12-17 08:34:47 +01:00
parent f8f4f86c21
commit d86557e66a
3 changed files with 6 additions and 7 deletions

View file

@ -21,7 +21,7 @@ options:
${OBJ}: config.mk
cmarkdown: ${OBJ}
@echo CC -o $@
@echo LD $@
@${CC} -o $@ ${OBJ} ${LDFLAGS}
clean:

View file

@ -64,8 +64,8 @@ struct Tag lineprefix[] = {
{ "# ", 1, "<h1>", "</h1>" },
};
struct Tag underline[] = {
{ "=", 1, "<h1>", "</h1>" },
{ "-", 1, "<h2>", "</h2>" },
{ "=", 1, "<h1>", "</h1>\n" },
{ "-", 1, "<h2>", "</h2>\n" },
};
struct Tag surround[] = {
{ "``", 0, "<code>", "</code>" },
@ -78,7 +78,6 @@ struct Tag surround[] = {
char * replace[][2] = {
{ "\n- - -\n", "\n<hr />\n" },
{ "\n- - - \n", "\n<hr />\n" },
{ " #######\n", "\n" },
{ " ######\n", "\n" },
{ " #####\n", "\n" },
{ " ####\n", "\n" },
@ -134,7 +133,8 @@ doamp(const char *begin, const char *end, int newblock) {
unsigned int
dohtml(const char *begin, const char *end, int newblock) {
const char *p, *tag, *tagend;
if(nohtml || *begin != '\n' || !*begin)
if(nohtml || !newblock || *begin == '\n')
return 0;
p = begin;
if(p[1] == '\n')
@ -533,4 +533,3 @@ main(int argc, char *argv[]) {
free(buffer);
return EXIT_SUCCESS;
}

View file

@ -10,7 +10,7 @@ INCS = -I. -I/usr/include
LIBS = -L/usr/lib
# flags
CFLAGS = -Os ${INCS} -DVERSION=\"${VERSION}\" -Wall
CFLAGS = -Os -Wall -Werror ${INCS} -DVERSION=\"${VERSION}\"
LDFLAGS = ${LIBS}
# compiler