Fossil

Check-in [a4d7e916]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Preserve the case of unknown HTML markup on wiki pages.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: a4d7e9162dc506a3b482514c5cbcb7fd075d6326
User & Date: drh 2008-05-16 13:55:05
Context
2008-05-16
15:44
The verbatim PRE tags now have class=fossil-verbatim to allow customization of the verbatim look/feel. check-in: 45451564 user: stephan tags: trunk
15:31
Resolve broken hyperlinks and other minor cleanup in the documentation. check-in: 16094f7e user: drh tags: trunk
13:55
Preserve the case of unknown HTML markup on wiki pages. check-in: a4d7e916 user: drh tags: trunk
13:31
Add the "Index Page" setup option to allow each site to configure a page to appear when no URL is specified or when the "Home" menu option is selected. check-in: c7c81df1 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/wikiformat.c.

597
598
599
600
601
602
603
604
605
606
607

608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629

630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
...
656
657
658
659
660
661
662
663
664

665
666
667
668
669
670
671
** z[] is an HTML markup element - something that begins with '<'.
** Parse this element into the p structure.
**
** The content of z[] might be modified by converting characters 
** to lowercase and by inserting some "\000" characters.
*/
static void parseMarkup(ParsedMarkup *p, char *z){
  int i, c;
  int iCode;
  char *zTag, *zValue;
  int seen = 0;


  if( z[1]=='/' ){
    p->endTag = 1;
    i = 2;
  }else{
    p->endTag = 0;
    i = 1;
  }
  zTag = &z[i];
  while( isalnum(z[i]) ){ 
    z[i] = tolower(z[i]);
    i++;
  }
  c = z[i];
  z[i] = 0;
  p->iCode = findTag(zTag);
  p->iType = aMarkup[p->iCode].iType;
  p->nAttr = 0;
  z[i] = c;
  while( isspace(z[i]) ){ i++; }
  while( p->nAttr<8 && isalpha(z[i]) ){
    zTag = &z[i];

    while( isalnum(z[i]) ){ 
      z[i] = tolower(z[i]);
      i++;
    }
    c = z[i];
    z[i] = 0;
    p->aAttr[p->nAttr].iCode = iCode = findAttr(zTag);
    z[i] = c;
    while( isspace(z[i]) ){ z++; }
    if( z[i]!='=' ){
      p->aAttr[p->nAttr].zValue = 0;
      p->aAttr[p->nAttr].cTerm = 0;
      c = 0;
    }else{
      i++;
................................................................................
      z[i] = 0;
      i++;
    }
    if( iCode!=0 && (seen & aAttribute[iCode].iMask)==0 ){
      seen |= aAttribute[iCode].iMask;
      p->nAttr++;
    }
    if( c=='>' ) break;
    while( isspace(z[i]) ){ i++; }

  }
}

/*
** Render markup on the given blob.
*/
static void renderMarkup(Blob *pOut, ParsedMarkup *p){







|

|

>








|

|


<
|



<


<
>

|


<
|

<







 







<

>







597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621

622
623
624
625

626
627

628
629
630
631
632

633
634

635
636
637
638
639
640
641
...
653
654
655
656
657
658
659

660
661
662
663
664
665
666
667
668
** z[] is an HTML markup element - something that begins with '<'.
** Parse this element into the p structure.
**
** The content of z[] might be modified by converting characters 
** to lowercase and by inserting some "\000" characters.
*/
static void parseMarkup(ParsedMarkup *p, char *z){
  int i, j, c;
  int iCode;
  char *zValue;
  int seen = 0;
  char zTag[100];

  if( z[1]=='/' ){
    p->endTag = 1;
    i = 2;
  }else{
    p->endTag = 0;
    i = 1;
  }
  j = 0;
  while( isalnum(z[i]) ){ 
    if( j<sizeof(zTag)-1 ) zTag[j++] = tolower(z[i]);
    i++;
  }

  zTag[j] = 0;
  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]) ){

    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);

    while( isspace(z[i]) ){ z++; }
    if( z[i]!='=' ){
      p->aAttr[p->nAttr].zValue = 0;
      p->aAttr[p->nAttr].cTerm = 0;
      c = 0;
    }else{
      i++;
................................................................................
      z[i] = 0;
      i++;
    }
    if( iCode!=0 && (seen & aAttribute[iCode].iMask)==0 ){
      seen |= aAttribute[iCode].iMask;
      p->nAttr++;
    }

    while( isspace(z[i]) ){ i++; }
    if( z[i]=='>' || (z[i]=='/' && z[i+1]=='>') ) break;
  }
}

/*
** Render markup on the given blob.
*/
static void renderMarkup(Blob *pOut, ParsedMarkup *p){