summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgottox@rootkit.lan <gottox@rootkit.lan>2007-12-17 08:34:47 +0100
committergottox@rootkit.lan <gottox@rootkit.lan>2007-12-17 08:34:47 +0100
commitd86557e66a684ce2bd3b16dab9a5e16d47c9df89 (patch)
tree4b62423ca39d9b49f98a6690de7686e9102150f9
parentf8f4f86c211d639b04480bd2ee57d8d7df8cc6c5 (diff)
Nicer output in Makefile; dounderline ends with \n; adding -Werror; dohtml uses newblock; some cleanups
-rw-r--r--Makefile2
-rw-r--r--cmarkdown.c9
-rw-r--r--config.mk2
3 files changed, 6 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 0a30bfa..3480c99 100644
--- a/Makefile
+++ b/Makefile
@@ -21,7 +21,7 @@ options:
${OBJ}: config.mk
cmarkdown: ${OBJ}
- @echo CC -o $@
+ @echo LD $@
@${CC} -o $@ ${OBJ} ${LDFLAGS}
clean:
diff --git a/cmarkdown.c b/cmarkdown.c
index 5d873f5..9891ad4 100644
--- a/cmarkdown.c
+++ b/cmarkdown.c
@@ -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;
}
-
diff --git a/config.mk b/config.mk
index b37839b..577b368 100644
--- a/config.mk
+++ b/config.mk
@@ -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