Merge pull request #1151 from ePaul/feature/1146-trim-whitespaces-before-escaping

trim strings before escaping
This commit is contained in:
wing328 2015-08-31 22:21:38 +08:00
commit dfb87abe3a

View File

@ -126,6 +126,7 @@ public class DefaultCodegen {
// override with any special text escaping logic
public String escapeText(String input) {
if (input != null) {
input = input.trim();
String output = input.replaceAll("\n", "\\\\n");
output = output.replace("\"", "\\\"");
return output;