Fossil

Changes On Branch andygoth-quote-apostrophe
Login

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

Changes In Branch andygoth-quote-apostrophe Excluding Merge-Ins

This is equivalent to a diff from 893905c83e to ca59c662d4

2016-11-04
20:49
Integrate andygoth-quote-apostrophe. Needed because single quotes can be used in the tag filter entry, and these single quotes would otherwise be passed through unprotected to the output HTML. check-in: 68bd2e7bed user: andygoth tags: andygoth-timeline-ms
2016-05-27
21:03
Compiler warning and coding style fixes. check-in: d037468910 user: mistachkin tags: trunk
2016-05-23
15:46
Merge trunk Closed-Leaf check-in: ca59c662d4 user: andygoth tags: andygoth-quote-apostrophe
15:45
Merge trunk Closed-Leaf check-in: 83bd4f37b1 user: andygoth tags: andygoth-brackets-outside-link
15:37
Merge trunk check-in: 1d2e740798 user: andygoth tags: reparent
15:37
Merge trunk Closed-Leaf check-in: 6164dac54c user: andygoth tags: andygoth-svn-import
15:34
Rename crnl-glob to crlf-glob, retaining support for crnl-glob as a compatibility alias. Change terminology from NL to LF throughout, excepting cases where NL means newline and not line feed. Also don't change linenoise.c which is third-party code. check-in: 2bc3cfebe6 user: andygoth tags: andygoth-crlf
01:05
Add brief documentation for compiling and using encrypted repositories. check-in: 893905c83e user: drh tags: trunk
2016-05-21
22:48
Point out that clean -prompt implies -disable-undo check-in: b5601dc3c4 user: andygoth tags: trunk
2016-04-10
02:14
Merge trunk. check-in: 023601fb14 user: andygoth tags: andygoth-quote-apostrophe

Changes to src/encode.c.
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "encode.h"

/*
** Make the given string safe for HTML by converting every "<" into "&lt;",
** every ">" into "&gt;" and every "&" into "&amp;".  Return a pointer
** to a new string obtained from malloc().
**
** We also encode " as &quot; so that it can appear as an argument
** to markup.
*/
char *htmlize(const char *zIn, int n){
  int c;
  int i = 0;
  int count = 0;
  char *zOut;







|







21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "encode.h"

/*
** Make the given string safe for HTML by converting every "<" into "&lt;",
** every ">" into "&gt;" and every "&" into "&amp;".  Return a pointer
** to a new string obtained from malloc().
**
** We also encode " as &quot; and ' as &#39; so they can appear as an argument
** to markup.
*/
char *htmlize(const char *zIn, int n){
  int c;
  int i = 0;
  int count = 0;
  char *zOut;
72
73
74
75
76
77
78







79
80
81
82
83
84
85
        zOut[i++] = '&';
        zOut[i++] = 'q';
        zOut[i++] = 'u';
        zOut[i++] = 'o';
        zOut[i++] = 't';
        zOut[i++] = ';';
        break;







      default:
        zOut[i++] = c;
        break;
    }
    zIn++;
  }
  zOut[i] = 0;







>
>
>
>
>
>
>







72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
        zOut[i++] = '&';
        zOut[i++] = 'q';
        zOut[i++] = 'u';
        zOut[i++] = 'o';
        zOut[i++] = 't';
        zOut[i++] = ';';
        break;
      case '\'':
        zOut[i++] = '&';
        zOut[i++] = '#';
        zOut[i++] = '3';
        zOut[i++] = '9';
        zOut[i++] = ';';
        break;
      default:
        zOut[i++] = c;
        break;
    }
    zIn++;
  }
  zOut[i] = 0;
110
111
112
113
114
115
116





117
118
119
120
121
122
123
        blob_append(p, "&amp;", 5);
        j = i+1;
        break;
      case '"':
        if( j<i ) blob_append(p, zIn+j, i-j);
        blob_append(p, "&quot;", 6);
        j = i+1;





        break;
    }
  }
  if( j<i ) blob_append(p, zIn+j, i-j);
}









>
>
>
>
>







117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
        blob_append(p, "&amp;", 5);
        j = i+1;
        break;
      case '"':
        if( j<i ) blob_append(p, zIn+j, i-j);
        blob_append(p, "&quot;", 6);
        j = i+1;
        break;
      case '\'':
        if( j<i ) blob_append(p, zIn+j, i-j);
        blob_append(p, "&#39;", 5);
        j = i+1;
        break;
    }
  }
  if( j<i ) blob_append(p, zIn+j, i-j);
}


Changes to src/markdown_html.c.
70
71
72
73
74
75
76


77
78
79
80
81
82
83
        BLOB_APPEND_LITERAL(ob, "&lt;");
      }else if( data[i]=='>' ){
        BLOB_APPEND_LITERAL(ob, "&gt;");
      }else if( data[i]=='&' ){
        BLOB_APPEND_LITERAL(ob, "&amp;");
      }else if( data[i]=='"' ){
        BLOB_APPEND_LITERAL(ob, "&quot;");


      }else{
        break;
      }
      i++;
    }
  }
}







>
>







70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
        BLOB_APPEND_LITERAL(ob, "&lt;");
      }else if( data[i]=='>' ){
        BLOB_APPEND_LITERAL(ob, "&gt;");
      }else if( data[i]=='&' ){
        BLOB_APPEND_LITERAL(ob, "&amp;");
      }else if( data[i]=='"' ){
        BLOB_APPEND_LITERAL(ob, "&quot;");
      }else if( data[i]=='\'' ){
        BLOB_APPEND_LITERAL(ob, "&#39;");
      }else{
        break;
      }
      i++;
    }
  }
}