]> git.armaanb.net Git - stagit.git/commitdiff
Move markdown article outside blob.
authorDemonstrandum <moi@knutsen.co>
Thu, 6 Aug 2020 02:24:52 +0000 (03:24 +0100)
committerDemonstrandum <moi@knutsen.co>
Thu, 6 Aug 2020 02:24:52 +0000 (03:24 +0100)
highlight
stagit.c

index 89cd98459dd0c9b691392f70d3678f84b7a438f1..28b18912a863b290923bbde17efae273cb871cf5 100755 (executable)
--- a/highlight
+++ b/highlight
@@ -44,10 +44,13 @@ if rendered:
     print('<article class="markup markdown">')
     print(rendered)
     print('</article>')
+print('<div id="blob">')
 print(highlight(contents, lexer, FORMAT))
+print('</div>')
 print('<style>')
 print(FORMAT.get_style_defs(''))
 print('</style>')
 
 print("Filename: {}; Lexer: {}.".format(filename, lexer), file=stderr)
-print("Markdown was rendered in addition.", file=stderr)
+if rendered:
+    print("Markdown was rendered in addition.", file=stderr)
index 98a18303ec65c96048cb500629696f146ddce360..7c88263689735963d214b9e9443b3b2f5530bdd4 100644 (file)
--- a/stagit.c
+++ b/stagit.c
@@ -434,14 +434,10 @@ writeblobhtml(const char *filename, FILE *fp, const git_blob *blob)
        const char *s = git_blob_rawcontent(blob);
        git_off_t len = git_blob_rawsize(blob);
 
-       fputs("<div id=\"blob\">\n", fp);
-
        if (len > 0) {
                lc = syntax_highlight(filename, fp, s, len);
        }
 
-       fputs("</div>\n", fp);
-
        return lc;
 }