你可以用ex编辑就地编辑HTML页面,例如:
ex -V1 $PAGE <
" Correcting missing protocol, see: https://github.com/wkhtmltopdf/wkhtmltopdf/issues/2359 "
%s,'//,'http://,ge
%s,"//,"http://,ge
" Correcting relative paths, see: https://github.com/wkhtmltopdf/wkhtmltopdf/issues/2359 "
%s,[^,]\zs'/\ze[^>],'http://www.example.com/,ge
%s,[^,]\zs"/\ze[^>],"http://www.example.com/,ge
" Remove the margin on the left of the main block. "
%s/id="doc_container"/id="doc_container" style="min-width:0px;margin-left : 0px;"/g
%s/
/
/
/
/
/
/id="leaderboard_ad_main">/norm nvatd
/class="page_missing_explanation/norm nvatd
/
/norm nvatd
/