Commit 8278ae5f authored by hj's avatar hj

更新提交

parent 8e1a2c47
......@@ -67,11 +67,11 @@ class ChemicalsMsdsService
$dlHtml = '';
if($dlContent['title'][$key]){
//$dlHtml = '<h2 style="font-size: 20px; text-align: center;" align="center">'.$dlContent['title'][$key].'</h2>';
preg_match_all('/<dt>(?<cTitle>[\s\S]*?)<\/dt>[\s]*?<dd>(?<cContent>[\s\S]*?)<\/dd>/i', $dl, $content);
if($content){
foreach($content['cTitle'] as $k => $c){
preg_match_all('/<dt>(?<cTitle>[\s\S]*?)<\/dt>[\s]*?<dd>(?<cContent>[\s\S]*?)<\/dd>/i', $dl, $ddContent);
if($ddContent){
foreach($ddContent['cTitle'] as $k => $c){
$dlHtml .= '<div><span style="margin: 0;">'.$c.'</span>';
$dlHtml .= '<span style="font-weight: normal">'.$content['cContent'][$k].'</span></div>';
$dlHtml .= '<span style="font-weight: normal">'.$ddContent['cContent'][$k].'</span></div>';
}
}
}
......@@ -79,6 +79,15 @@ class ChemicalsMsdsService
}
}
}
preg_match('/(?<title>第[\s]*?3[\s\S]+?)<table[\s]*?class=[\\\'|\"]table-text-center avoid-page-break-inside[\\\'|\"]>[\s\S]*?<\/table>/i', $content['content'], $tableContent);
if($tableContent['title']){
$msds_html = str_replace($tableContent['title'],'<h2 style="font-size: 1.6rem;font-weight: bold">'.$tableContent['title'].'</h2>', $msds_html);
}
preg_match('/(?<title>第4[\s\S]*?)<dl>[\s\S]*?<\/dl>/i', $content['content'], $dlContent);
if($dlContent['title']){
$msds_html = str_replace($dlContent['title'],'<h2 style="font-size: 1.6rem;font-weight: bold">'.$dlContent['title'].'</h2>', $msds_html);
}
}
}
......
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