Transcoder.class will now add @startuml, to we have to check if it is
present before adding it
This commit is contained in:
@@ -167,14 +167,19 @@ 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 {
|
||||||
StringBuilder plantUmlSource = new StringBuilder();
|
final String uml;
|
||||||
plantUmlSource.append("@startuml\n");
|
if (text.startsWith("@startuml")) {
|
||||||
plantUmlSource.append(text);
|
uml = text;
|
||||||
if (text.endsWith("\n") == false) {
|
} else {
|
||||||
plantUmlSource.append("\n");
|
StringBuilder plantUmlSource = new StringBuilder();
|
||||||
}
|
plantUmlSource.append("@startuml\n");
|
||||||
plantUmlSource.append("@enduml");
|
plantUmlSource.append(text);
|
||||||
final String uml = plantUmlSource.toString();
|
if (text.endsWith("\n") == false) {
|
||||||
|
plantUmlSource.append("\n");
|
||||||
|
}
|
||||||
|
plantUmlSource.append("@enduml");
|
||||||
|
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)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user