diff --git a/WEB-INF/src/net/sourceforge/plantuml/servlet/PlantUmlServlet.java b/WEB-INF/src/net/sourceforge/plantuml/servlet/PlantUmlServlet.java index ca77de9..9b73851 100644 --- a/WEB-INF/src/net/sourceforge/plantuml/servlet/PlantUmlServlet.java +++ b/WEB-INF/src/net/sourceforge/plantuml/servlet/PlantUmlServlet.java @@ -148,7 +148,10 @@ public class PlantUmlServlet extends HttpServlet { StringBuilder plantUmlSource = new StringBuilder(); plantUmlSource.append("@startuml\n"); plantUmlSource.append(text); - plantUmlSource.append("\n@enduml"); + if (text.endsWith("\n") == false) { + plantUmlSource.append("\n"); + } + plantUmlSource.append("@enduml"); final String uml = plantUmlSource.toString(); SourceStringReader reader = new SourceStringReader(uml); // Write the first image to "os" @@ -188,4 +191,4 @@ public class PlantUmlServlet extends HttpServlet { } } -} \ No newline at end of file +}