Fix other macros as well
This commit is contained in:
parent
81c551552b
commit
a91d45dea5
@ -17,6 +17,9 @@ public class OperatingSystemMacro extends InlineMacroProcessor {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object process(ContentNode contentNode, String target, Map<String, Object> attributes) {
|
public Object process(ContentNode contentNode, String target, Map<String, Object> attributes) {
|
||||||
return System.getProperty("os.name");
|
var osName = System.getProperty("os.name");
|
||||||
|
|
||||||
|
//see https://discuss.asciidoctor.org/How-to-create-inline-macro-producing-HTML-In-AsciidoctorJ-td8313.html for why quoted is used
|
||||||
|
return createPhraseNode(contentNode, "quoted", osName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,11 @@ public class WebGoatTmpDirMacro extends InlineMacroProcessor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String process(ContentNode contentNode, String target, Map<String, Object> attributes) {
|
public Object process(ContentNode contentNode, String target, Map<String, Object> attributes) {
|
||||||
return EnvironmentExposure.getEnv().getProperty("webgoat.server.directory");
|
var env = EnvironmentExposure.getEnv().getProperty("webgoat.server.directory");
|
||||||
|
|
||||||
|
//see https://discuss.asciidoctor.org/How-to-create-inline-macro-producing-HTML-In-AsciidoctorJ-td8313.html for why quoted is used
|
||||||
|
return createPhraseNode(contentNode, "quoted", env);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,10 @@ public class WebGoatVersionMacro extends InlineMacroProcessor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String process(ContentNode contentNode, String target, Map<String, Object> attributes) {
|
public Object process(ContentNode contentNode, String target, Map<String, Object> attributes) {
|
||||||
return EnvironmentExposure.getEnv().getProperty("webgoat.build.version");
|
var webgoatVersion = EnvironmentExposure.getEnv().getProperty("webgoat.build.version");
|
||||||
|
|
||||||
|
//see https://discuss.asciidoctor.org/How-to-create-inline-macro-producing-HTML-In-AsciidoctorJ-td8313.html for why quoted is used
|
||||||
|
return createPhraseNode(contentNode, "quoted", webgoatVersion);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user