Nicer output in Makefile; dounderline ends with \n; adding -Werror; dohtml uses newblock; some cleanups - smu - smu - simple markup (Markdown) processor (fork, fixes + features)
 (HTM) git clone git://git.codemadness.org/smu
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit d86557e66a684ce2bd3b16dab9a5e16d47c9df89
 (DIR) parent f8f4f86c211d639b04480bd2ee57d8d7df8cc6c5
 (HTM) Author: gottox@rootkit.lan <gottox@rootkit.lan>
       Date:   Mon, 17 Dec 2007 08:34:47 +0100
       
       Nicer output in Makefile; dounderline ends with \n; adding -Werror; dohtml uses newblock; some cleanups
       
       Diffstat:
         M Makefile                            |       2 +-
         M cmarkdown.c                         |       9 ++++-----
         M config.mk                           |       2 +-
       
       3 files changed, 6 insertions(+), 7 deletions(-)
       ---
 (DIR) diff --git a/Makefile b/Makefile
       @@ -21,7 +21,7 @@ options:
        ${OBJ}: config.mk
        
        cmarkdown: ${OBJ}
       -        @echo CC -o $@
       +        @echo LD $@
                @${CC} -o $@ ${OBJ} ${LDFLAGS}
        
        clean:
 (DIR) diff --git 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;
        }
       -
 (DIR) diff --git 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