Diff
Not logged in

Differences From:

File src/wikiformat.c part of check-in [bb542b80c7] - renamed fossil-verbatim to verbatim for consistency with other CSS elements. Added a reasonable default .verbatim entry. by stephan on 2008-05-16 15:54:00. Also file src/wikiformat.c part of check-in [81eb00def7] - Merge in stephan's fork. by drh on 2008-05-16 16:01:06. [view]

To:

File src/wikiformat.c part of check-in [71104b898d] - Bug fix in wiki rendering. Avoid terminating the output when an an unrecognized markup attribute appears inside <verbatim>. by drh on 2008-06-08 16:19:14. [view]

@@ -624,15 +624,17 @@
   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;
@@ -647,14 +649,16 @@
       }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++; }