Diff
Not logged in

Differences From:

File src/wikiformat.c part of check-in [50a58adb76] - Many changes and bug fixes in the wiki processing. Moving toward a workable wiki system. The "Home" menu option now takes you to the wiki page whose name is the same as the Project Name. There is a "wcontent" page, but no link to it yet. Many other changes. by drh on 2007-10-10 21:15:17. [view]

To:

File src/wikiformat.c part of check-in [df646a7f4c] - Fix some (certainly not all) problems with wiki editing. by drh on 2007-10-12 23:18:35. [view]

@@ -67,8 +67,9 @@
 static const struct AllowedAttribute {
   const char *zName;
   unsigned int iMask;
 } aAttribute[] = {
+  { 0, 0 },
   { "align",         ATTR_ALIGN,          },
   { "alt",           ATTR_ALT,            },
   { "bgcolor",       ATTR_BGCOLOR,        },
   { "border",        ATTR_BORDER,         },
@@ -98,15 +99,15 @@
 ** Use binary search to locate a tag in the aAttribute[] table.
 */
 static int findAttr(const char *z){
   int i, c, first, last;
-  first = 0;
+  first = 1;
   last = sizeof(aAttribute)/sizeof(aAttribute[0]) - 1;
   while( first<=last ){
     i = (first+last)/2;
     c = strcmp(aAttribute[i].zName, z);
     if( c==0 ){
-      return aAttribute[i].iMask;
+      return i;
     }else if( c<0 ){
       first = i+1;
     }else{
       last = i-1;
@@ -657,9 +658,9 @@
     blob_appendf(pOut, "</%s>", aMarkup[p->iCode].zName);
   }else{
     blob_appendf(pOut, "<%s", aMarkup[p->iCode].zName);
     for(i=0; i<p->nAttr; i++){
-      blob_appendf(pOut, " %s", aAttribute[p->aAttr[i].iCode]);
+      blob_appendf(pOut, " %s", aAttribute[p->aAttr[i].iCode].zName);
       if( p->aAttr[i].zValue ){
         blob_appendf(pOut, "=\"%s\"", p->aAttr[i].zValue);
       }
     }