summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2018-05-12 18:37:56 +0100
committerMichael Williamson <mike@zwobble.org>2018-05-12 18:37:56 +0100
commit3d1e91e36b259dc8a648c43134f91d334b8d2da4 (patch)
treecf3b6acdde44bd1e2b2d517382881df051847454
parentd3f02ae97fadff8209a3bda6644b8334c3b01279 (diff)
Remove unused code
-rw-r--r--lib/writers/html-writer.js14
-rw-r--r--lib/writers/markdown-writer.js7
-rw-r--r--test/writers/html-writer.tests.js6
3 files changed, 8 insertions, 19 deletions
diff --git a/lib/writers/html-writer.js b/lib/writers/html-writer.js
index e16feec..16c848f 100644
--- a/lib/writers/html-writer.js
+++ b/lib/writers/html-writer.js
@@ -62,11 +62,6 @@ function prettyWriter() {
writer.selfClosing(tagName, attributes);
}
- function append(html) {
- startText();
- writer.append(html.replace("\n", "\n" + indentation));
- }
-
function insideIndentedElement() {
return stack.length === 0 || indentedElements[stack[stack.length - 1]];
}
@@ -81,9 +76,9 @@ function prettyWriter() {
function indent() {
inText = false;
if (!start && insideIndentedElement() && !isInPre()) {
- writer.append("\n");
+ writer._append("\n");
for (var i = 0; i < indentationLevel; i++) {
- writer.append(indentation);
+ writer._append(indentation);
}
}
}
@@ -99,8 +94,7 @@ function prettyWriter() {
open: open,
close: close,
text: text,
- selfClosing: selfClosing,
- append: append
+ selfClosing: selfClosing
};
}
@@ -146,7 +140,7 @@ function simpleWriter() {
close: close,
text: text,
selfClosing: selfClosing,
- append: append
+ _append: append
};
}
diff --git a/lib/writers/markdown-writer.js b/lib/writers/markdown-writer.js
index 4284532..a89ad9f 100644
--- a/lib/writers/markdown-writer.js
+++ b/lib/writers/markdown-writer.js
@@ -141,10 +141,6 @@ function markdownWriter() {
fragments.push(escapeMarkdown(value));
}
- function append(html) {
- fragments.push(html);
- }
-
function asString() {
return fragments.join("");
}
@@ -154,8 +150,7 @@ function markdownWriter() {
open: open,
close: close,
text: text,
- selfClosing: selfClosing,
- append: append
+ selfClosing: selfClosing
};
}
diff --git a/test/writers/html-writer.tests.js b/test/writers/html-writer.tests.js
index b91cba8..0b48d73 100644
--- a/test/writers/html-writer.tests.js
+++ b/test/writers/html-writer.tests.js
@@ -92,8 +92,8 @@ test('run of text has only one new line', function() {
test('run of html has only one new line', function() {
var writer = htmlWriter.writer({prettyPrint: true});
writer.open("p");
- writer.append("One");
- writer.append("Two");
+ writer.text("One");
+ writer.text("Two");
writer.close("p");
return assert.equal(writer.asString(), "<p>\n OneTwo\n</p>");
});
@@ -109,7 +109,7 @@ test('self closing elements are indented', function() {
test('newlines in appended HTML are indented', function() {
var writer = htmlWriter.writer({prettyPrint: true});
writer.open("p");
- writer.append("One\nTwo");
+ writer.text("One\nTwo");
writer.close("p");
return assert.equal(writer.asString(), "<p>\n One\n Two\n</p>");
});