From c3d21de4677b9bf7433b4ee8083cc0077b2922c3 Mon Sep 17 00:00:00 2001 From: CyC2018 Date: Sun, 1 Nov 2026 19:07:30 +0800 Subject: [PATCH] Update test_site_assets.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 补充测试:行内代码中的三个反引号不影响后面图片的发布。 --- website/builder/test_site_assets.py | 6 ++++++ 1 file changed, 6 insertions(+) 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: