aboutsummaryrefslogtreecommitdiff
path: root/lib/html-generator.js
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2013-04-01 12:55:21 +0100
committerMichael Williamson <mike@zwobble.org>2013-04-01 12:55:21 +0100
commitad75779025dd2fdae2eab851e1be1c6e5b8955ef (patch)
tree087f2c0d5db242347096c05808ece9f340f4f94a /lib/html-generator.js
parentc9f133942a541fbcae95720b5b0480b94e36c00f (diff)
Generate HTML for bold elements
Diffstat (limited to 'lib/html-generator.js')
-rw-r--r--lib/html-generator.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/html-generator.js b/lib/html-generator.js
index af6cedc..38e3619 100644
--- a/lib/html-generator.js
+++ b/lib/html-generator.js
@@ -21,6 +21,15 @@ function HtmlGenerator() {
return fragments.join("");
}
+ function append(otherHtmlGenerator) {
+ if (otherHtmlGenerator._fragments.length > 0) {
+ writeAll();
+ }
+ otherHtmlGenerator._fragments.forEach(function(fragment) {
+ fragments.push(fragment);
+ });
+ }
+
function style(style) {
var firstFreshPartIndex = findIndex(style, function(part) {
return part.fresh;
@@ -82,7 +91,10 @@ function HtmlGenerator() {
return {
style: style,
text: text,
- asString: asString
+ closeAll: popAll,
+ asString: asString,
+ append: append,
+ _fragments: fragments
};
}