fix {|} separator in the presence of alignments. fixes #146.

This commit is contained in:
Christopher Jeffrey 2015-06-27 03:06:08 -07:00
parent 36d94d41a6
commit 9f1552c687
1 changed files with 3 additions and 1 deletions

View File

@ -557,6 +557,7 @@ Element.prototype._parseAttr = function(lines) {
Element.prototype._align = function(line, width, align) { Element.prototype._align = function(line, width, align) {
if (!align) return line; if (!align) return line;
//if (!align && !~line.indexOf('{|}')) return line;
var cline = line.replace(/\x1b\[[\d;]*m/g, '') var cline = line.replace(/\x1b\[[\d;]*m/g, '')
, len = cline.length , len = cline.length
@ -635,7 +636,8 @@ main:
} }
if (cap = /{\/(left|center|right)}$/.exec(line)) { if (cap = /{\/(left|center|right)}$/.exec(line)) {
line = line.slice(0, -cap[0].length); line = line.slice(0, -cap[0].length);
state = null; //state = null;
state = this.align;
} }
} }