aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/document-to-html.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/document-to-html.js b/lib/document-to-html.js
index 3d3e8db..ab02b64 100644
--- a/lib/document-to-html.js
+++ b/lib/document-to-html.js
@@ -107,7 +107,7 @@ function DocumentConversion(options) {
convertElements(run.children, messages, function(error, children) {
var result = Html.fragment(children);
if (run.isStrikethrough) {
- result = convertStrikethrough(result);
+ result = convertRunProperty(result, "strikethrough", "s");
}
if (run.isUnderline) {
result = convertUnderline(result);
@@ -122,7 +122,7 @@ function DocumentConversion(options) {
result = wrapInNonFreshElement(result, "em");
}
if (run.isBold) {
- result = wrapInNonFreshElement(result, "strong");
+ result = convertRunProperty(result, "bold", "strong");
}
if (style) {
result = Html.pathToNode(style.to, [result]);
@@ -139,12 +139,12 @@ function DocumentConversion(options) {
return (options.convertUnderline || defaultConvertUnderline)(runHtml);
}
- function convertStrikethrough(result) {
- var style = findStyle({type: "strikethrough"});
+ function convertRunProperty(result, elementType, defaultTagName) {
+ var style = findStyle({type: elementType});
if (style) {
return Html.pathToNode(style.to, [result]);
} else {
- return wrapInNonFreshElement(result, "s");
+ return wrapInNonFreshElement(result, defaultTagName);
}
}