使用Groovy时MarkupBuilder,我需要将文本输出到文档中的位置,或者调用将文本输出到文档中的函数.目前,我正在使用未定义的标签"text"来进行输出.有没有更好的方法来编写这段代码?
li {
text("${type.getAlias()} blah blah ")
function1(type.getXYZ())
if (type instanceof Class1) {
text(" implements ")
ft.getList().each {
if (it == '') return
text(it)
if (!function2(type, it)) text(", ")
}
}
}
Run Code Online (Sandbox Code Playgroud)