File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -110,20 +110,20 @@ gh_toc(){
110110 local toc=` gh_toc_md2html " $gh_src " | gh_toc_grab " $gh_src_copy " `
111111 echo " $toc "
112112 if [ " $need_replace " = " yes" ]; then
113- local ts=" \ <\!--ts--\ >"
114- local te=" \ <\!--te--\ >"
113+ local ts=" <\!--ts-->"
114+ local te=" <\!--te-->"
115115 local dt=` date +' %F_%H%M%S' `
116116 local ext=" .orig.${dt} "
117117 local toc_path=" ${gh_src} .toc.${dt} "
118118 local toc_footer=" <!-- Added by: ` whoami` , at: ` date --iso-8601=' minutes' ` -->"
119119 # http://fahdshariff.blogspot.ru/2012/12/sed-mutli-line-replacement-between-two.html
120120 # clear old TOC
121- sed -i " ${ext} " -e " /${ts} /,/${te} / {//!d; }" " $gh_src "
121+ sed -i${ext} " /${ts} /,/${te} /{//!d}" " $gh_src "
122122 # create toc file
123123 echo " ${toc} " > " ${toc_path} "
124124 echo -e " \n${toc_footer} \n" >> " $toc_path "
125125 # insert toc file
126- sed -i " " -e " /${ts} /r ${toc_path} " " $gh_src "
126+ sed -i " /${ts} /r ${toc_path} " " $gh_src "
127127 echo
128128 echo " !! TOC was added into: '$gh_src '"
129129 echo " !! Origin version of the file: '${gh_src}${ext} '"
You can’t perform that action at this time.
0 commit comments