From a7ee8cf22ee3df737684193a1f9f1eb949f05162 Mon Sep 17 00:00:00 2001 From: vmishenev Date: Tue, 22 Feb 2022 00:10:35 +0300 Subject: [PATCH] Call deprecated `handleCommand` --- .../templates/DirectiveBasedTemplateProcessing.kt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/templating/src/main/kotlin/templates/DirectiveBasedTemplateProcessing.kt b/plugins/templating/src/main/kotlin/templates/DirectiveBasedTemplateProcessing.kt index 7ef4cb10eb..0da2c76225 100644 --- a/plugins/templating/src/main/kotlin/templates/DirectiveBasedTemplateProcessing.kt +++ b/plugins/templating/src/main/kotlin/templates/DirectiveBasedTemplateProcessing.kt @@ -16,6 +16,7 @@ import org.jsoup.nodes.Node import org.jsoup.nodes.TextNode import java.io.File import java.nio.file.Files +import kotlin.reflect.full.declaredFunctions class DirectiveBasedHtmlTemplateProcessingStrategy(private val context: DokkaContext) : TemplateProcessingStrategy { @@ -42,7 +43,14 @@ class DirectiveBasedHtmlTemplateProcessingStrategy(private val context: DokkaCon } else false fun handleCommandAsTag(element: Element, command: Command, input: File, output: File) { - traverseHandlers(command) { handleCommandAsTag(command, element, input, output) } + traverseHandlers(command) { + + @Suppress("DEPRECATION") + if (this::class.declaredFunctions.firstOrNull { it.name == "handleCommand" } != null) // for deprecated handleCommand + handleCommand(element, command, input, output) + else + handleCommandAsTag(command, element, input, output) + } } fun handleCommandAsComment(command: Command, body: List, input: File, output: File) {