正文段落一

正文段落二,需要足够长的文字才能通过提取阈值校验。
来源
HTML;
$body = NewsContentHtml::extractBody($html);
$this->assertNotNull($body);
$this->assertStringContainsString('正文段落一', $body);
$this->assertStringContainsString('/resource/upload/', $body);
}
public function test_resolves_relative_image_src(): void
{
$normalized = NewsContentHtml::normalize(
'
',
'https://news.sjtu.edu.cn/jdyw/20260408/221279.html'
);
$this->assertStringContainsString('https://news.sjtu.edu.cn/resource/upload/a.png', $normalized);
}
}