You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
606 B
Groovy

package org.xbib.gradle.plugin.asciidoctor.groovydsl.extensions
import org.asciidoctor.ast.ContentNode
import org.asciidoctor.extension.InlineMacroProcessor
class DelegatingInlineMacroProcessor extends InlineMacroProcessor {
private final Closure cl
DelegatingInlineMacroProcessor(String name, Map options, @DelegatesTo(InlineMacroProcessor) Closure cl) {
super(name, options)
this.cl = cl
cl.delegate = this
}
@Override
Object process(ContentNode parent, String target, Map<String, Object> attributes) {
cl.call(parent, target, attributes)
}
}