Commit 3b1dac78 authored by hj's avatar hj

更新提交

parent 82d44daf
...@@ -34,8 +34,8 @@ class ChemicalsMsdsService ...@@ -34,8 +34,8 @@ class ChemicalsMsdsService
} }
preg_match('/<body>[\s]*?<style>(?<bodyStyle>[\s\S]*?)<\/style>/i',$msds_html, $bodyStyle); preg_match('/<body>[\s]*?<style>(?<bodyStyle>[\s\S]*?)<\/style>/i',$msds_html, $bodyStyle);
$bodyStyle['bodyStyle'] = "<style>body{ font-family: 'msyh'; font-size: 0.8rem; font-weight: normal; display: block;} h2{font-size: 2.2rem; text-align: center;}.container { padding-right: 5px;padding-left: 5px;margin-right: auto;margin-left: auto;width: 100%;} .sds-cn dd p { font-weight: normal; margin-left: 20px; }" . $bodyStyle['bodyStyle'] = "<style>body{ font-family: 'msyh'; font-size: 0.7rem; font-weight: normal; display: block;} h2{font-size: 2.2rem; text-align: center;}.container { padding-right: 5px;padding-left: 5px;margin-right: auto;margin-left: auto;width: 100%;} .sds-cn dd p { font-weight: normal; margin-left: 20px; }" .
$bodyStyle['bodyStyle']."</style><body><div class='container'>"; $bodyStyle['bodyStyle']."</style><body>";
// 格式化处理 // 格式化处理
$bodyStyle['bodyStyle'] = preg_replace('/\.sds-cn[\s]*?\{[\s]*?line-height: 1.5;[\s]*?\}/i', '.sds-cn{line-height: 2.5;}', $bodyStyle['bodyStyle']); $bodyStyle['bodyStyle'] = preg_replace('/\.sds-cn[\s]*?\{[\s]*?line-height: 1.5;[\s]*?\}/i', '.sds-cn{line-height: 2.5;}', $bodyStyle['bodyStyle']);
...@@ -55,7 +55,7 @@ class ChemicalsMsdsService ...@@ -55,7 +55,7 @@ class ChemicalsMsdsService
//$msds_html = preg_replace('/<\/dd>/i', '</p></dd>', $msds_html); //$msds_html = preg_replace('/<\/dd>/i', '</p></dd>', $msds_html);
$msds_html = preg_replace('/<body><style>(?<bodyStyle>[\s\S]*?)<\/style>/i', '@body@', $msds_html); $msds_html = preg_replace('/<body><style>(?<bodyStyle>[\s\S]*?)<\/style>/i', '@body@', $msds_html);
$msds_html = preg_replace('/<\/body>/', '</div></body>', preg_replace('/@body@/', $bodyStyle['bodyStyle'], $msds_html)); $msds_html = preg_replace('/<\/body>/', '</body>', preg_replace('/@body@/', $bodyStyle['bodyStyle'], $msds_html));
//$msds_html = preg_replace('/@body@/', $newMsdsHtml, $msds_html); //$msds_html = preg_replace('/@body@/', $newMsdsHtml, $msds_html);
if(preg_match('/<div[\s]*?class=[\\\'|\"]sds-cn-content[\\\'|\"]>(?<content>[\s\S]+?)<\/div><\/body>/i', $msds_html, $content)){ if(preg_match('/<div[\s]*?class=[\\\'|\"]sds-cn-content[\\\'|\"]>(?<content>[\s\S]+?)<\/div><\/body>/i', $msds_html, $content)){
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment