From e56b92d78e0d0195a1d62dad2274f6822cbcfb15 Mon Sep 17 00:00:00 2001 From: oc Date: Thu, 15 Feb 2018 19:01:43 +0800 Subject: [PATCH] Support \\n --- libs/core.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libs/core.js b/libs/core.js index 61139cd2..9567dbe1 100644 --- a/libs/core.js +++ b/libs/core.js @@ -3931,6 +3931,10 @@ core.prototype.splitLines = function(canvas, text, maxLength, font) { contents.push(text.substring(last, i)); last=i+1; } + else if (text.charAt(i)=='\\' && text.charAt(i+1)=='n') { + contents.push(text.substring(last, i)); + last=i+2; + } else { var toAdd = text.substring(last, i+1); var width = core.canvas[canvas].measureText(toAdd).width;