From 79247daec78b71b5c56b7987ccd86a032d5390f6 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sun, 23 Jan 2011 17:12:37 +1100 Subject: [PATCH] Don't output blank lines for empty pageinfo sections. --- common/content/buffer.js | 9 ++++----- common/modules/template.jsm | 1 - 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/common/content/buffer.js b/common/content/buffer.js index abbfb23c..21008477 100644 --- a/common/content/buffer.js +++ b/common/content/buffer.js @@ -486,7 +486,7 @@ var Buffer = Module("buffer", { * section's output. */ addPageInfoSection: function addPageInfoSection(option, title, func) { - this.pageInfo[option] = [func, title]; + this.pageInfo[option] = [func, title]; // TODO: are these reversed intentionally? --djk }, /** @@ -1023,10 +1023,9 @@ var Buffer = Module("buffer", { return; } - let option = sections || options["pageinfo"]; - let list = template.map(option, function (option) { - let opt = buffer.pageInfo[option]; - return opt ? template.table(opt[1], opt[0](true)) : undefined; + let list = template.map(sections || options["pageinfo"], function (option) { + let [data, title] = buffer.pageInfo[option]; + return template.table(title, data(true)); },
); dactyl.echo(list, commandline.FORCE_MULTILINE); }, diff --git a/common/modules/template.jsm b/common/modules/template.jsm index 483cc1d8..91b6613b 100644 --- a/common/modules/template.jsm +++ b/common/modules/template.jsm @@ -292,7 +292,6 @@ var Template = Module("Template", { // if (table.tr.length() > 1) return table; - return XML(); }, tabular: function tabular(headings, style, iter) {