From 683f46435f981308d12b8bf8d5b2d961ebc519ab Mon Sep 17 00:00:00 2001 From: darksnake Date: Mon, 3 Jul 2023 13:38:07 +0300 Subject: [PATCH] Fix image names --- src/main/kotlin/process.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/process.kt b/src/main/kotlin/process.kt index a676da1..5ae6f67 100644 --- a/src/main/kotlin/process.kt +++ b/src/main/kotlin/process.kt @@ -76,7 +76,7 @@ internal suspend fun SpaceClient.processMarkdownDocument(path: Path) = coroutine val newText = documentBody.replace(regex) { val id = it.groups["id"]?.value ?: error("Unexpected reference format: ${it.value}") val alt = it.groups["alt"]?.value - val imageName = alt ?: id + val imageName = alt?.let { "$id-$alt" } ?: id logger.info("Downloading image $id as images/$imageName") launch(Dispatchers.IO) { extractImage(path.parent, id, imageName)