From 68a681c30a265c1b293fdd148d662b8169d64bae Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Wed, 14 Oct 2015 19:18:30 +0100 Subject: Use html.nonFreshElement in document-to-html --- lib/document-to-html.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lib') diff --git a/lib/document-to-html.js b/lib/document-to-html.js index f296c11..3d3e8db 100644 --- a/lib/document-to-html.js +++ b/lib/document-to-html.js @@ -113,16 +113,16 @@ function DocumentConversion(options) { result = convertUnderline(result); } if (run.verticalAlignment === documents.verticalAlignment.subscript) { - result = wrap(result, "sub"); + result = wrapInNonFreshElement(result, "sub"); } if (run.verticalAlignment === documents.verticalAlignment.superscript) { - result = wrap(result, "sup"); + result = wrapInNonFreshElement(result, "sup"); } if (run.isItalic) { - result = wrap(result, "em"); + result = wrapInNonFreshElement(result, "em"); } if (run.isBold) { - result = wrap(result, "strong"); + result = wrapInNonFreshElement(result, "strong"); } if (style) { result = Html.pathToNode(style.to, [result]); @@ -131,8 +131,8 @@ function DocumentConversion(options) { }); } - function wrap(node, tagName) { - return Html.elementWithTag(htmlPaths.element(tagName, {}, {fresh: false}), [node]); + function wrapInNonFreshElement(node, tagName) { + return Html.nonFreshElement(tagName, {}, [node]); } function convertUnderline(runHtml) { @@ -144,7 +144,7 @@ function DocumentConversion(options) { if (style) { return Html.pathToNode(style.to, [result]); } else { - return wrap(result, "s"); + return wrapInNonFreshElement(result, "s"); } } -- cgit v1.2.3