aboutsummaryrefslogtreecommitdiff
path: root/lib/documents.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/documents.js
parentc9f133942a541fbcae95720b5b0480b94e36c00f (diff)
Generate HTML for bold elements
Diffstat (limited to 'lib/documents.js')
-rw-r--r--lib/documents.js14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/documents.js b/lib/documents.js
index eebd607..ba2e8ec 100644
--- a/lib/documents.js
+++ b/lib/documents.js
@@ -46,15 +46,23 @@ function DocumentConverter(options) {
function styleForParagraph(element) {
return paragraphStyleMap[element.properties.styleName] || defaultParagraphStyle;
}
+
+ function convertRun(run, html) {
+ var runHtml = new HtmlGenerator();
+ if (run.properties.isBold) {
+ runHtml.style(styles.elements(["strong"]));
+ }
+ convertElements(run.children, runHtml);
+ runHtml.closeAll();
+ html.append(runHtml);
+ }
var elementConverters = {
"document": function(document, html) {
convertElements(document.children, html);
},
"paragraph": convertParagraph,
- "run": function(element, html) {
- convertElements(element.children, html);
- },
+ "run": convertRun,
"text": function(element, html) {
html.text(element.value);
}