Fossil SCM

Rename the htmlTagLength() function to html_tag_length().

drh 2020-06-01 13:11 trunk
Commit 3f99bca912466f98149eb897a1c856469485c0970bd406b00eaef1e485343250
--- src/markdown_html.c
+++ src/markdown_html.c
@@ -142,11 +142,11 @@
142142
&& size>9
143143
&& title!=0
144144
&& sqlite3_strnicmp("<h1",data,3)==0
145145
&& sqlite3_strnicmp("</h1>", &data[size-5],5)==0
146146
){
147
- int nTag = htmlTagLength(data);
147
+ int nTag = html_tag_length(data);
148148
blob_append(title, data+nTag, size - nTag - 5);
149149
return;
150150
}
151151
INTER_BLOCK(ob);
152152
blob_append(ob, data, size);
153153
--- src/markdown_html.c
+++ src/markdown_html.c
@@ -142,11 +142,11 @@
142 && size>9
143 && title!=0
144 && sqlite3_strnicmp("<h1",data,3)==0
145 && sqlite3_strnicmp("</h1>", &data[size-5],5)==0
146 ){
147 int nTag = htmlTagLength(data);
148 blob_append(title, data+nTag, size - nTag - 5);
149 return;
150 }
151 INTER_BLOCK(ob);
152 blob_append(ob, data, size);
153
--- src/markdown_html.c
+++ src/markdown_html.c
@@ -142,11 +142,11 @@
142 && size>9
143 && title!=0
144 && sqlite3_strnicmp("<h1",data,3)==0
145 && sqlite3_strnicmp("</h1>", &data[size-5],5)==0
146 ){
147 int nTag = html_tag_length(data);
148 blob_append(title, data+nTag, size - nTag - 5);
149 return;
150 }
151 INTER_BLOCK(ob);
152 blob_append(ob, data, size);
153
--- src/wikiformat.c
+++ src/wikiformat.c
@@ -469,11 +469,11 @@
469469
** z points to a "<" character. Check to see if this is the start of
470470
** a valid markup. If it is, return the total number of characters in
471471
** the markup including the initial "<" and the terminating ">". If
472472
** it is not well-formed markup, return 0.
473473
*/
474
-int htmlTagLength(const char *z){
474
+int html_tag_length(const char *z){
475475
int n = 1;
476476
int inparen = 0;
477477
int c;
478478
if( z[n]=='/' ){ n++; }
479479
if( !fossil_isalpha(z[n]) ) return 0;
@@ -656,11 +656,11 @@
656656
** characters in that token. Write the token type into *pTokenType.
657657
*/
658658
static int nextWikiToken(const char *z, Renderer *p, int *pTokenType){
659659
int n;
660660
if( z[0]=='<' ){
661
- n = htmlTagLength(z);
661
+ n = html_tag_length(z);
662662
if( n>0 ){
663663
*pTokenType = TOKEN_MARKUP;
664664
return n;
665665
}else{
666666
*pTokenType = TOKEN_CHARACTER;
@@ -2026,11 +2026,11 @@
20262026
*/
20272027
int html_token_length(const char *z){
20282028
int n;
20292029
char c;
20302030
if( (c=z[0])=='<' ){
2031
- n = htmlTagLength(z);
2031
+ n = html_tag_length(z);
20322032
if( n<=0 ) n = 1;
20332033
}else if( fossil_isspace(c) ){
20342034
for(n=1; z[n] && fossil_isspace(z[n]); n++){}
20352035
}else if( c=='&' ){
20362036
n = z[1]=='#' ? 2 : 1;
20372037
--- src/wikiformat.c
+++ src/wikiformat.c
@@ -469,11 +469,11 @@
469 ** z points to a "<" character. Check to see if this is the start of
470 ** a valid markup. If it is, return the total number of characters in
471 ** the markup including the initial "<" and the terminating ">". If
472 ** it is not well-formed markup, return 0.
473 */
474 int htmlTagLength(const char *z){
475 int n = 1;
476 int inparen = 0;
477 int c;
478 if( z[n]=='/' ){ n++; }
479 if( !fossil_isalpha(z[n]) ) return 0;
@@ -656,11 +656,11 @@
656 ** characters in that token. Write the token type into *pTokenType.
657 */
658 static int nextWikiToken(const char *z, Renderer *p, int *pTokenType){
659 int n;
660 if( z[0]=='<' ){
661 n = htmlTagLength(z);
662 if( n>0 ){
663 *pTokenType = TOKEN_MARKUP;
664 return n;
665 }else{
666 *pTokenType = TOKEN_CHARACTER;
@@ -2026,11 +2026,11 @@
2026 */
2027 int html_token_length(const char *z){
2028 int n;
2029 char c;
2030 if( (c=z[0])=='<' ){
2031 n = htmlTagLength(z);
2032 if( n<=0 ) n = 1;
2033 }else if( fossil_isspace(c) ){
2034 for(n=1; z[n] && fossil_isspace(z[n]); n++){}
2035 }else if( c=='&' ){
2036 n = z[1]=='#' ? 2 : 1;
2037
--- src/wikiformat.c
+++ src/wikiformat.c
@@ -469,11 +469,11 @@
469 ** z points to a "<" character. Check to see if this is the start of
470 ** a valid markup. If it is, return the total number of characters in
471 ** the markup including the initial "<" and the terminating ">". If
472 ** it is not well-formed markup, return 0.
473 */
474 int html_tag_length(const char *z){
475 int n = 1;
476 int inparen = 0;
477 int c;
478 if( z[n]=='/' ){ n++; }
479 if( !fossil_isalpha(z[n]) ) return 0;
@@ -656,11 +656,11 @@
656 ** characters in that token. Write the token type into *pTokenType.
657 */
658 static int nextWikiToken(const char *z, Renderer *p, int *pTokenType){
659 int n;
660 if( z[0]=='<' ){
661 n = html_tag_length(z);
662 if( n>0 ){
663 *pTokenType = TOKEN_MARKUP;
664 return n;
665 }else{
666 *pTokenType = TOKEN_CHARACTER;
@@ -2026,11 +2026,11 @@
2026 */
2027 int html_token_length(const char *z){
2028 int n;
2029 char c;
2030 if( (c=z[0])=='<' ){
2031 n = html_tag_length(z);
2032 if( n<=0 ) n = 1;
2033 }else if( fossil_isspace(c) ){
2034 for(n=1; z[n] && fossil_isspace(z[n]); n++){}
2035 }else if( c=='&' ){
2036 n = z[1]=='#' ? 2 : 1;
2037

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button