Skip to content

Commit

Permalink
Call deprecated handleCommand
Browse files Browse the repository at this point in the history
  • Loading branch information
vmishenev committed Feb 21, 2022
1 parent 8c7a477 commit a7ee8cf
Showing 1 changed file with 9 additions and 1 deletion.
Expand Up @@ -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 {

Expand All @@ -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<Node>, input: File, output: File) {
Expand Down

0 comments on commit a7ee8cf

Please sign in to comment.