Skip to content
This repository has been archived by the owner on Jan 23, 2019. It is now read-only.

Commit

Permalink
Escape quotes at the beginning without ending pair (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lonami committed Apr 15, 2018
1 parent da54ebb commit 76d13f3
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,8 @@ public static String sanitizeContent(String content) {

// Quotes are a bit special
case '"':
if (i == 0 || i == length - 1)
if ((i == 0 && content.charAt(length - 1) == '"') ||
(i == length - 1 && content.charAt(0) == '"'))
sb.append('"');
else
sb.append("\\\"");
Expand Down

0 comments on commit 76d13f3

Please sign in to comment.