Revision: 1880 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=1880&view=re... Author: frlan Date: 2011-01-27 02:18:59 +0000 (Thu, 27 Jan 2011)
Log Message: ----------- HTMLTable: Adding some comments
Modified Paths: -------------- trunk/geany-plugins/htmltable/src/htmltable.c
Modified: trunk/geany-plugins/htmltable/src/htmltable.c =================================================================== --- trunk/geany-plugins/htmltable/src/htmltable.c 2011-01-27 02:18:38 UTC (rev 1879) +++ trunk/geany-plugins/htmltable/src/htmltable.c 2011-01-27 02:18:59 UTC (rev 1880) @@ -63,10 +63,13 @@ { /* Adding header to replacement */ replacement_str = g_string_new("<table>\n"); + + /* Adding <thead> if requested */ if (header == TRUE) { g_string_append(replacement_str, "<thead>\n"); } + /* Iteration onto rows and building up lines of table for * replacement */
@@ -77,11 +80,15 @@ { gchar **columns = NULL; columns = g_strsplit_set(rows[i], "\t", -1); + + /* Adding <tbody> after first line if header and body + * is requested */ if (i == 1 && header == TRUE) { g_string_append(replacement_str, "<tbody>\n"); } + g_string_append(replacement_str, "\t<tr>\n"); for (j = 0; columns[j] != NULL; j++) { @@ -89,18 +96,23 @@ g_string_append(replacement_str, columns[j]); g_string_append(replacement_str, "</td>\n"); } - g_string_append(replacement_str, - "\t</tr>\n"); + + g_string_append(replacement_str, "\t</tr>\n"); + + /* Adding closing </thead> after first row if header + * is requested */ if (i == 0 && header == TRUE) { g_string_append(replacement_str, "</thead>\n"); } + g_free(columns); } }
/* Adding the footer of table */ + /* Closing </tbody> if requested */ if (header == TRUE) { g_string_append(replacement_str, "</tbody>\n");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.