From 9f1552c687d3310f779d4c3da9feab121e8701f5 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Sat, 27 Jun 2015 03:06:08 -0700 Subject: [PATCH] fix {|} separator in the presence of alignments. fixes #146. --- lib/widgets/element.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/widgets/element.js b/lib/widgets/element.js index d5b2494..57c4ebb 100644 --- a/lib/widgets/element.js +++ b/lib/widgets/element.js @@ -557,6 +557,7 @@ Element.prototype._parseAttr = function(lines) { Element.prototype._align = function(line, width, align) { if (!align) return line; + //if (!align && !~line.indexOf('{|}')) return line; var cline = line.replace(/\x1b\[[\d;]*m/g, '') , len = cline.length @@ -635,7 +636,8 @@ main: } if (cap = /{\/(left|center|right)}$/.exec(line)) { line = line.slice(0, -cap[0].length); - state = null; + //state = null; + state = this.align; } }