From b9b1b588fad604c0cfc3e481f48338437dcaba5f Mon Sep 17 00:00:00 2001 From: Vadim Mishenev Date: Tue, 22 Feb 2022 12:56:41 +0300 Subject: Fix HTML head and favicon in multi-module projects (#2365) --- .../src/main/kotlin/ResolveLinkCommandHandler.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'plugins/all-modules-page/src') diff --git a/plugins/all-modules-page/src/main/kotlin/ResolveLinkCommandHandler.kt b/plugins/all-modules-page/src/main/kotlin/ResolveLinkCommandHandler.kt index e881a5ab..7976ba5a 100644 --- a/plugins/all-modules-page/src/main/kotlin/ResolveLinkCommandHandler.kt +++ b/plugins/all-modules-page/src/main/kotlin/ResolveLinkCommandHandler.kt @@ -16,29 +16,29 @@ class ResolveLinkCommandHandler(context: DokkaContext) : CommandHandler { private val externalModuleLinkResolver = context.plugin().querySingle { externalModuleLinkResolver } - override fun handleCommand(element: Element, command: Command, input: File, output: File) { + override fun handleCommandAsTag(command: Command, body: Element, input: File, output: File) { command as ResolveLinkCommand val link = externalModuleLinkResolver.resolve(command.dri, output) if (link == null) { - val children = element.childNodes().toList() + val children = body.childNodes().toList() val attributes = Attributes().apply { put("data-unresolved-link", command.dri.toString()) } val el = Element(Tag.valueOf("span"), "", attributes).apply { children.forEach { ch -> appendChild(ch) } } - element.replaceWith(el) + body.replaceWith(el) return } val attributes = Attributes().apply { put("href", link) } - val children = element.childNodes().toList() + val children = body.childNodes().toList() val el = Element(Tag.valueOf("a"), "", attributes).apply { children.forEach { ch -> appendChild(ch) } } - element.replaceWith(el) + body.replaceWith(el) } override fun canHandle(command: Command): Boolean = command is ResolveLinkCommand -- cgit