[fossil-users] [PATCH] Tag in HTML generated from Markdown

Mon, 22 Sep 2014 12:05:30 -0700

The trivial patch below adds a "markdown" class to <table> HTML elements generated from tables on Markdown-formatted wiki pages:

Index: src/markdown_html.c
==================================================================
--- src/markdown_html.c
+++ src/markdown_html.c
@@ -176,11 +176,11 @@
   struct Blob *head_row,
   struct Blob *rows,
   void *opaque
 ){
   INTER_BLOCK(ob);
-  BLOB_APPEND_LITTERAL(ob, "<table>\n");
+  BLOB_APPEND_LITTERAL(ob, "<table class=\"markdown\">\n");
   if( head_row && blob_size(head_row)>0 ){
     BLOB_APPEND_LITTERAL(ob, "<thead>\n");
     BLOB_APPEND_BLOB(ob, head_row);
     BLOB_APPEND_LITTERAL(ob, "</thead>\n<tbody>\n");
   }

This allows such tables to be styled differently than all the other uses of <table> in Fossil UI, such as the Timeline view.

If one were really motivated, one would add lots of other CSS classes to disambiguate other HTML tags. :)

Also, I found two different existing class names while poking around, and couldn't see evidence of a naming scheme style: timelineTable and label-value. Perhaps this is worth fixing, or perhaps it can't be fixed now that there may be existing CSS that depends on the existing names.
_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to