Index: src/markdown.cpp
===================================================================
RCS file: /cygdrive/d/cvs_doxygen/doxygen/doxygen/src/markdown.cpp,v
retrieving revision 1.10
diff -u -r1.10 markdown.cpp
--- src/markdown.cpp	26 Mar 2013 18:38:04 -0000	1.10
+++ src/markdown.cpp	1 Apr 2013 11:38:41 -0000
@@ -1426,15 +1426,17 @@
  *  @param[out] start offset of the first character of the table content
  *  @param[out] end   offset of the last character of the table content
  *  @param[out] columns number of table columns found
+ *  @param[out] singleColumn table with a single column
  *  @returns The offset until the next line in the buffer.
  */
-int findTableColumns(const char *data,int size,int &start,int &end,int &columns)
+static int findTableColumns(const char *data,int size,int &start,int &end,int &columns, int &singleColumn)
 {
   int i=0;
   int eol;
+  int single_column_table = 0;
   // find start character of the table line
   while (i<size && data[i]==' ') i++;
-  if (i<size && data[i]=='|') i++; // leading | does not count
+  if (i<size && data[i]=='|') {i++; single_column_table += 1;}// leading | does not count
   start = i;
 
   // find end character of the table line
@@ -1442,7 +1444,7 @@
   eol=i+1;
   i--;
   while (i>0 && data[i]==' ') i--;
-  if (i>0 && data[i]=='|') i--; // trailing | does not count
+  if (i>0 && data[i]=='|') {i--; single_column_table += 1;}// trailing | does not count
   end = i;
 
   // count columns between start and end
@@ -1456,6 +1458,8 @@
       i++;
     }
   }
+  singleColumn=0;
+  if (columns==1 && single_column_table==2) singleColumn=1;
   //printf("findTableColumns(start=%d,end=%d,columns=%d) eol=%d\n",
   //    start,end,columns,eol);
   return eol;
@@ -1465,17 +1469,19 @@
 static bool isTableBlock(const char *data,int size)
 {
   int cc0,start,end;
+  int sc0;
 
   // the first line should have at least two columns separated by '|'
-  int i = findTableColumns(data,size,start,end,cc0);
-  if (i>=size || cc0<2) 
+  int i = findTableColumns(data,size,start,end,cc0,sc0);
+  if (i>=size || (cc0<2 && sc0==0)) 
   {
     //printf("isTableBlock: no |'s in the header\n");
     return FALSE;
   }
 
   int cc1;
-  int ret = findTableColumns(data+i,size-i,start,end,cc1);
+  int sc1;
+  int ret = findTableColumns(data+i,size-i,start,end,cc1,sc1);
   int j=i+start;
   // separator line should consist of |, - and : and spaces only
   while (j<=end+i)
@@ -1487,25 +1493,28 @@
     }
     j++;
   }
-  if (cc1!=cc0) // number of columns should be same as previous line
+  if (cc1!=cc0 || sc0!=sc1) // number of columns should be same as previous line
   {
     return FALSE;
   }
 
   i+=ret; // goto next line
   int cc2;
-  ret = findTableColumns(data+i,size-i,start,end,cc2);
+  int sc2;
+  ret = findTableColumns(data+i,size-i,start,end,cc2,sc2);
 
   //printf("isTableBlock: %d\n",cc1==cc2);
-  return cc1==cc2;
+  return (cc1==cc2 && sc1==sc2);
 }
 
 static int writeTableBlock(GrowBuf &out,const char *data,int size)
 {
   int i=0,j,k;
   int columns,start,end,cc;
+  int sc;
+  int singleColumn;
 
-  i = findTableColumns(data,size,start,end,columns);
+  i = findTableColumns(data,size,start,end,columns,singleColumn);
   
   out.addStr("<table>");
 
@@ -1516,7 +1525,7 @@
   int headerEnd = end;
 
   // read cell alignments
-  int ret = findTableColumns(data+i,size-i,start,end,cc);
+  int ret = findTableColumns(data+i,size-i,start,end,cc,sc);
   k=0;
   Alignment *columnAlignment = new Alignment[columns];
 
@@ -1577,9 +1586,9 @@
   // write table cells
   while (i<size)
   {
-    int ret = findTableColumns(data+i,size-i,start,end,cc);
+    int ret = findTableColumns(data+i,size-i,start,end,cc,sc);
     //printf("findTableColumns cc=%d\n",cc);
-    if (cc!=columns) break; // end of table
+    if (cc!=columns||sc!=singleColumn) break; // end of table
 
     out.addStr("<tr>");
     j=start+i;
