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
607 B
Groovy
21 lines
607 B
Groovy
package org.xbib.gradle.plugin.asciidoctor.groovydsl.extensions
|
|
|
|
import org.asciidoctor.ast.StructuralNode
|
|
import org.asciidoctor.extension.BlockMacroProcessor
|
|
|
|
class DelegatingBlockMacroProcessor extends BlockMacroProcessor {
|
|
|
|
private final Closure cl
|
|
|
|
DelegatingBlockMacroProcessor(String name, Map options, @DelegatesTo(BlockMacroProcessor) Closure cl) {
|
|
super(name, options)
|
|
this.cl = cl
|
|
cl.delegate = this
|
|
}
|
|
|
|
@Override
|
|
Object process(StructuralNode parent, String target, Map<String, Object> attributes) {
|
|
cl.call(parent, target, attributes)
|
|
}
|
|
}
|