mirror of
https://github.com/octoleo/plantuml-server.git
synced 2025-02-09 14:08:25 +00:00
Transcoder.class will now add @startuml, to we have to check if it is
present before adding it
This commit is contained in:
parent
e9fbf4b0e4
commit
e71536f634
@ -167,6 +167,10 @@ public class PlantUmlServlet extends HttpServlet {
|
|||||||
|
|
||||||
private void sendImage(HttpServletResponse response, String text, String uri)
|
private void sendImage(HttpServletResponse response, String text, String uri)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
final String uml;
|
||||||
|
if (text.startsWith("@startuml")) {
|
||||||
|
uml = text;
|
||||||
|
} else {
|
||||||
StringBuilder plantUmlSource = new StringBuilder();
|
StringBuilder plantUmlSource = new StringBuilder();
|
||||||
plantUmlSource.append("@startuml\n");
|
plantUmlSource.append("@startuml\n");
|
||||||
plantUmlSource.append(text);
|
plantUmlSource.append(text);
|
||||||
@ -174,7 +178,8 @@ public class PlantUmlServlet extends HttpServlet {
|
|||||||
plantUmlSource.append("\n");
|
plantUmlSource.append("\n");
|
||||||
}
|
}
|
||||||
plantUmlSource.append("@enduml");
|
plantUmlSource.append("@enduml");
|
||||||
final String uml = plantUmlSource.toString();
|
uml = plantUmlSource.toString();
|
||||||
|
}
|
||||||
// Write the first image to "os"
|
// Write the first image to "os"
|
||||||
long today = System.currentTimeMillis();
|
long today = System.currentTimeMillis();
|
||||||
if ( StringUtils.isDiagramCacheable( uml)) {
|
if ( StringUtils.isDiagramCacheable( uml)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user