File tree 2 files changed +6
-0
lines changed
2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ function buildChm( $cpp = true )
51
51
{
52
52
$ filelow = strtolower ( $ file );
53
53
$ relativename = substr ( $ filelow , strlen ( $ sourceDir ) + 1 );
54
+ $ relativename = str_replace ( "% " , "_ " , $ relativename ); // escape %
54
55
55
56
// current file
56
57
//echo( $relativename."\n" );
@@ -151,6 +152,10 @@ function buildChm( $cpp = true )
151
152
$ new_value = str_replace ( "/ " , "- " , $ e ->getAttribute ("title " ));
152
153
// fix bad titles where space is used instead of _
153
154
$ new_value = str_replace ( " " , "_ " , $ new_value );
155
+ if (! strstr ($ new_value , "http " )) {
156
+ // escape relative %
157
+ $ new_value = str_replace ( "% " , "_ " , urlencode ($ new_value ));
158
+ }
154
159
155
160
$ e ->setAttribute ("href " , $ new_value .".html " );
156
161
Original file line number Diff line number Diff line change @@ -45,5 +45,6 @@ sed -i '/chmhelp\\首页.html/d' "${i}"
45
45
mv " ${i} " " chm_temp/${i} "
46
46
" ${ICONV} " -c -f UTF-8 -t GB18030 " chm_temp/${i} " > " ${i} "
47
47
done
48
+ rm -rf chm_temp
48
49
49
50
" ${HHC} " cppreference.hhp
You can’t perform that action at this time.
0 commit comments