feat(asset): add AssetID to ContentChunk and update image handling in HTML content

This commit is contained in:
mlogclub
2026-04-17 13:35:00 +08:00
parent f4761d768c
commit 0037b97f29
5 changed files with 18 additions and 108 deletions
+7
View File
@@ -51,6 +51,13 @@ func TestSplitHTMLContentChunks(t *testing.T) {
{Type: ContentChunkTypeText, Content: "后文"},
},
},
{
name: "image with asset metadata only",
content: `<p><img data-asset-id="asset_1" data-provider="local" data-storage-key="images/a.png" alt="a"></p>`,
want: []ContentChunk{
{Type: ContentChunkTypeImage, AssetID: "asset_1"},
},
},
{
name: "empty html returns empty chunks",
content: "<p><br></p>",