summaryrefslogtreecommitdiffstats
path: root/src/markdown.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/markdown.cpp')
-rw-r--r--src/markdown.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/markdown.cpp b/src/markdown.cpp
index c15516e..a3ac468 100644
--- a/src/markdown.cpp
+++ b/src/markdown.cpp
@@ -1466,19 +1466,20 @@ int findTableColumns(const char *data,int size,int &start,int &end,int &columns)
// count columns between start and end
columns=0;
- if (n==2) // table row has | ... |
- {
- columns++;
- }
if (end>start)
{
i=start;
while (i<=end) // look for more column markers
{
if (data[i]=='|' && (i==0 || data[i-1]!='\\')) columns++;
+ if (columns==1) columns++; // first | make a non-table into a two column table
i++;
}
}
+ if (n==2 && columns==0) // table row has | ... |
+ {
+ columns++;
+ }
//printf("findTableColumns(start=%d,end=%d,columns=%d) eol=%d\n",
// start,end,columns,eol);
return eol;