401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
|
int doc_is_embedded_html(Blob *pContent, Blob *pTitle){
const char *zIn = blob_str(pContent);
const char *zAttr;
const char *zValue;
int nAttr, nValue;
int seenClass = 0;
int seenTitle = 0;
while( fossil_isspace(zIn[0]) ) zIn++;
if( fossil_strnicmp(zIn,"<div",4)!=0 ) return 0;
zIn += 4;
while( zIn[0] ){
if( fossil_isspace(zIn[0]) ) zIn++;
if( zIn[0]=='>' ) return 0;
zAttr = zIn;
|
|
|
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
|
int doc_is_embedded_html(Blob *pContent, Blob *pTitle){
const char *zIn = blob_str(pContent);
const char *zAttr;
const char *zValue;
int nAttr, nValue;
int seenClass = 0;
int seenTitle = 0;
while( fossil_isspace(zIn[0]) ) zIn++;
if( fossil_strnicmp(zIn,"<div",4)!=0 ) return 0;
zIn += 4;
while( zIn[0] ){
if( fossil_isspace(zIn[0]) ) zIn++;
if( zIn[0]=='>' ) return 0;
zAttr = zIn;
|
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
|
if( nAttr==10 && fossil_strnicmp(zAttr,"data-title",10)==0 ){
blob_append(pTitle, zValue, nValue);
seenTitle = 1;
if( seenClass ) return 1;
}
}
return seenClass;
}
/*
** Look for a file named zName in the checkin with RID=vid. Load the content
** of that file into pContent and return the RID for the file. Or return 0
** if the file is not found or could not be loaded.
*/
int doc_load_content(int vid, const char *zName, Blob *pContent){
|
|
|
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
|
if( nAttr==10 && fossil_strnicmp(zAttr,"data-title",10)==0 ){
blob_append(pTitle, zValue, nValue);
seenTitle = 1;
if( seenClass ) return 1;
}
}
return seenClass;
}
/*
** Look for a file named zName in the checkin with RID=vid. Load the content
** of that file into pContent and return the RID for the file. Or return 0
** if the file is not found or could not be loaded.
*/
int doc_load_content(int vid, const char *zName, Blob *pContent){
|