{
Header *h = (Header *)node->data;
- g_printf ("%d: %s\n", g_node_depth (node), h->str);
+ if (h->level == 0)
+ {
+ return FALSE;
+ }
+
+ g_printf ("%d: %s\n", h->level, h->str);
if (h->tags != NULL)
{
g_printf ("\tTAGS %s\n", h->tags);
{
if (strline[l] == ' ')
{
- h->level = l - 1;
+ h->level = l;
break;
}
}
if (rx_start > 0)
{
- h->str = g_strndup (strline, rx_start);
+ h->str = g_strndup (strline + h->level + 1, rx_start - (h->level + 1));
}
else
{
- h->str = g_strdup (strline);
+ h->str = g_strdup (strline + h->level + 1);
}
g_strstrip (h->str);