正文段落一

图

正文段落二,需要足够长的文字才能通过提取阈值校验。

来源
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); } public function test_extracts_pedata_article_main(): void { $html = <<<'HTML'

清科研究中心正文段落一,包含足够长的文字用于通过正文提取阈值校验。

第二段正文内容继续补充长度,确保 strip_tags 后超过三十个字符。

版权声明
HTML; $body = NewsContentHtml::extractBody($html); $this->assertNotNull($body); $this->assertStringContainsString('清科研究中心正文段落一', $body); } }