feat(asset): add AssetID to ContentChunk and update image handling in HTML content
This commit is contained in:
@@ -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>",
|
||||
|
||||
Reference in New Issue
Block a user