Chore: ignore 'favourites'-layer when calculating 'usedImages' to display attribution

This commit is contained in:
Pieter Vander Vennet 2024-04-22 14:43:05 +02:00
parent 42fb487d95
commit bfe2398565
4 changed files with 34 additions and 29 deletions

View file

@ -191,7 +191,7 @@ export class ExtractImages extends Conversion<
continue
}
allFoundImages.push({
context: context + "." + foundElement.path.join("."),
context: context.path.join(".") + "." + foundElement.path.join("."),
path: foundElement.leaf,
})
}
@ -202,7 +202,7 @@ export class ExtractImages extends Conversion<
for (const foundImage of allFoundImages) {
if (foundImage.path.startsWith("<") && foundImage.path.endsWith(">")) {
// These is probably html - we ignore
// This is probably html
const doc = parse_html(foundImage.path)
const images = Array.from(doc.getElementsByTagName("img"))
const paths = images.map((i) => i.getAttribute("src"))