Fossil SCM

For help-text search, include the name of the command or setting as part of the searchable text. Also: Fix a bug in HTML-to-text translation of snippets.

drh 2025-02-26 17:38 trunk
Commit 55dd9896d7973e51d08984f55cbbc86d18cdea4db389811e6cc788e566925944
1 file changed +4 -3
+4 -3
--- src/search.c
+++ src/search.c
@@ -622,14 +622,14 @@
622622
j += 3;
623623
}else if( memcmp(&zSnip[j],">",4)==0 ){
624624
zSnip[k++] = '>';
625625
j += 3;
626626
}else if( memcmp(&zSnip[j],""",6)==0 ){
627
- zSnip[k++] = '<';
627
+ zSnip[k++] = '"';
628628
j += 5;
629629
}else if( memcmp(&zSnip[j],"&amp;",5)==0 ){
630
- zSnip[k++] = '<';
630
+ zSnip[k++] = '&';
631631
j += 4;
632632
}else{
633633
zSnip[k++] = c;
634634
}
635635
}else{
@@ -1046,11 +1046,12 @@
10461046
" '/help?cmd='||name,"
10471047
" search_score(),"
10481048
" 'h'||rowid,"
10491049
" search_snippet()"
10501050
" FROM helptext"
1051
- " WHERE search_match('',helptext.helptext);"
1051
+ " WHERE search_match(format('the \"%%s\" %%s',name,type),"
1052
+ " helptext.helptext);"
10521053
);
10531054
}
10541055
}
10551056
10561057
/*
10571058
--- src/search.c
+++ src/search.c
@@ -622,14 +622,14 @@
622 j += 3;
623 }else if( memcmp(&zSnip[j],"&gt;",4)==0 ){
624 zSnip[k++] = '>';
625 j += 3;
626 }else if( memcmp(&zSnip[j],"&quot;",6)==0 ){
627 zSnip[k++] = '<';
628 j += 5;
629 }else if( memcmp(&zSnip[j],"&amp;",5)==0 ){
630 zSnip[k++] = '<';
631 j += 4;
632 }else{
633 zSnip[k++] = c;
634 }
635 }else{
@@ -1046,11 +1046,12 @@
1046 " '/help?cmd='||name,"
1047 " search_score(),"
1048 " 'h'||rowid,"
1049 " search_snippet()"
1050 " FROM helptext"
1051 " WHERE search_match('',helptext.helptext);"
 
1052 );
1053 }
1054 }
1055
1056 /*
1057
--- src/search.c
+++ src/search.c
@@ -622,14 +622,14 @@
622 j += 3;
623 }else if( memcmp(&zSnip[j],"&gt;",4)==0 ){
624 zSnip[k++] = '>';
625 j += 3;
626 }else if( memcmp(&zSnip[j],"&quot;",6)==0 ){
627 zSnip[k++] = '"';
628 j += 5;
629 }else if( memcmp(&zSnip[j],"&amp;",5)==0 ){
630 zSnip[k++] = '&';
631 j += 4;
632 }else{
633 zSnip[k++] = c;
634 }
635 }else{
@@ -1046,11 +1046,12 @@
1046 " '/help?cmd='||name,"
1047 " search_score(),"
1048 " 'h'||rowid,"
1049 " search_snippet()"
1050 " FROM helptext"
1051 " WHERE search_match(format('the \"%%s\" %%s',name,type),"
1052 " helptext.helptext);"
1053 );
1054 }
1055 }
1056
1057 /*
1058

Keyboard Shortcuts

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