Check-in [71104b898d]
Not logged in
Overview

SHA1 Hash:71104b898d05fe56419b9a600febe0cacca8a570
Date: 2008-06-08 16:19:14
User: drh
Comment:Bug fix in wiki rendering. Avoid terminating the output when an an unrecognized markup attribute appears inside <verbatim>.
Timelines: ancestors | descendants | both | trunk
Other Links: files | ZIP archive | manifest

Tags And Properties
Changes
[hide diffs]

Modified src/wikiformat.c from [33d82dd4cf] to [e49b2821f4].

@@ -623,17 +623,19 @@
   p->iCode = findTag(zTag);
   p->iType = aMarkup[p->iCode].iType;
   p->nAttr = 0;
   while( isspace(z[i]) ){ i++; }
   while( p->nAttr<8 && isalpha(z[i]) ){
+    int attrOk;    /* True to preserver attribute.  False to ignore it */
     j = 0;
     while( isalnum(z[i]) ){
       if( j<sizeof(zTag)-1 ) zTag[j++] = tolower(z[i]);
       i++;
     }
     zTag[j] = 0;
     p->aAttr[p->nAttr].iCode = iCode = findAttr(zTag);
+    attrOk = iCode!=0 && (seen & aAttribute[iCode].iMask)==0;
     while( isspace(z[i]) ){ z++; }
     if( z[i]!='=' ){
       p->aAttr[p->nAttr].zValue = 0;
       p->aAttr[p->nAttr].cTerm = 0;
       c = 0;
@@ -646,16 +648,18 @@
         while( z[i] && z[i]!='"' ){ i++; }
       }else{
         zValue = &z[i];
         while( !isspace(z[i]) && z[i]!='>' ){ z++; }
       }
-      p->aAttr[p->nAttr].zValue = zValue;
-      p->aAttr[p->nAttr].cTerm = c = z[i];
-      z[i] = 0;
+      if( attrOk ){
+        p->aAttr[p->nAttr].zValue = zValue;
+        p->aAttr[p->nAttr].cTerm = c = z[i];
+        z[i] = 0;
+      }
       i++;
     }
-    if( iCode!=0 && (seen & aAttribute[iCode].iMask)==0 ){
+    if( attrOk ){
       seen |= aAttribute[iCode].iMask;
       p->nAttr++;
     }
     while( isspace(z[i]) ){ i++; }
     if( z[i]=='>' || (z[i]=='/' && z[i+1]=='>') ) break;