File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 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 )
5151 {
5252 $ filelow = strtolower ( $ file );
5353 $ relativename = substr ( $ filelow , strlen ( $ sourceDir ) + 1 );
54+ $ relativename = str_replace ( "% " , "_ " , $ relativename ); // escape %
5455
5556 // current file
5657 //echo( $relativename."\n" );
@@ -151,6 +152,10 @@ function buildChm( $cpp = true )
151152 $ new_value = str_replace ( "/ " , "- " , $ e ->getAttribute ("title " ));
152153 // fix bad titles where space is used instead of _
153154 $ new_value = str_replace ( " " , "_ " , $ new_value );
155+ if (! strstr ($ new_value , "http " )) {
156+ // escape relative %
157+ $ new_value = str_replace ( "% " , "_ " , urlencode ($ new_value ));
158+ }
154159
155160 $ e ->setAttribute ("href " , $ new_value .".html " );
156161
Original file line number Diff line number Diff line change @@ -45,5 +45,6 @@ sed -i '/chmhelp\\首页.html/d' "${i}"
4545mv " ${i} " " chm_temp/${i} "
4646" ${ICONV} " -c -f UTF-8 -t GB18030 " chm_temp/${i} " > " ${i} "
4747done
48+ rm -rf chm_temp
4849
4950" ${HHC} " cppreference.hhp
You can’t perform that action at this time.
0 commit comments