diff --git a/website/builder/test_site_assets.py b/website/builder/test_site_assets.py index bfda55ab..cf6fb7f9 100644 --- a/website/builder/test_site_assets.py +++ b/website/builder/test_site_assets.py @@ -45,6 +45,12 @@ class SearchIndexTests(unittest.TestCase): content = '\n```html\n\n```\n\n[正文](/notes/示例.md)\n' self.assertEqual(set(referenced_paths(content)), {'notes/pics/actual.png', 'notes/示例.md'}) + def test_inline_triple_backticks_do_not_hide_later_images(self): + # 正文中的行内代码 ```` ```json ```` 不是代码块,后面的图片仍要发布 + content = ('例如包在 ```` ```json ```` 代码块里。\n\n\n\n' + '- 列表\n\n ```text\n \n ```\n\n\n') + self.assertEqual(set(referenced_paths(content)), {'notes/pics/a.png', 'notes/pics/b.png'}) + def test_image_manifest_stable_across_file_creation_order(self): from PIL import Image with tempfile.TemporaryDirectory() as directory: