From e0397dcd7f650e86898ceab97eedc5753494d9f5 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Wed, 14 Oct 2015 19:17:07 +0100 Subject: Rename html.element to html.freshElement --- lib/document-to-html.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'lib/document-to-html.js') diff --git a/lib/document-to-html.js b/lib/document-to-html.js index eef0f8e..f296c11 100644 --- a/lib/document-to-html.js +++ b/lib/document-to-html.js @@ -199,20 +199,20 @@ function DocumentConversion(options) { } function convertTable(element, messages, callback) { - wrapChildren(element, "table", messages, callback); + wrapChildrenInFreshElement(element, "table", messages, callback); } function convertTableRow(element, messages, callback) { - wrapChildren(element, "tr", messages, callback); + wrapChildrenInFreshElement(element, "tr", messages, callback); } function convertTableCell(element, messages, callback) { - wrapChildren(element, "td", messages, callback); + wrapChildrenInFreshElement(element, "td", messages, callback); } - function wrapChildren(element, wrapElementName, messages, callback) { + function wrapChildrenInFreshElement(element, wrapElementName, messages, callback) { convertElements(element.children, messages, function(error, children) { - callback(null, Html.element(wrapElementName, {}, [ + callback(null, Html.freshElement(wrapElementName, {}, [ Html.forceWrite, Html.fragment(children)])); }); @@ -227,7 +227,7 @@ function DocumentConversion(options) { convertElements(notes, messages, function(error, notesNodes) { callback(null, Html.fragment([ Html.fragment(children), - Html.element("ol", {}, notesNodes)])); + Html.freshElement("ol", {}, notesNodes)])); }); }); }, @@ -243,19 +243,19 @@ function DocumentConversion(options) { var href = element.anchor ? "#" + htmlId(element.anchor) : element.href; convertElements(element.children, messages, function(error, children) { - callback(null, Html.element("a", {href: href}, children)); + callback(null, Html.freshElement("a", {href: href}, children)); }); }, "bookmarkStart": function(element, messages, callback) { - callback(null, Html.element("a", { + callback(null, Html.freshElement("a", { id: htmlId(element.name) }, [Html.forceWrite])); }, "noteReference": function(element, messages, callback) { noteReferences.push(element); - callback(null, Html.element("sup", {}, [ - Html.element("a", { + callback(null, Html.freshElement("sup", {}, [ + Html.freshElement("a", { href: "#" + noteHtmlId(element), id: noteRefHtmlId(element) }, [Html.text("[" + (noteNumber++) + "]")]) @@ -263,12 +263,12 @@ function DocumentConversion(options) { }, "note": function(element, messages, callback) { convertElements(element.body, messages, function(error, children) { - callback(null, Html.element("li", {id: noteHtmlId(element)}, [ + callback(null, Html.freshElement("li", {id: noteHtmlId(element)}, [ Html.fragment(children), Html.elementWithTag(htmlPaths.element("p", {}, {fresh: false}), [ Html.text(" "), - Html.element("a", {href: "#" + noteRefHtmlId(element)}, [Html.text("↑")]), + Html.freshElement("a", {href: "#" + noteRefHtmlId(element)}, [Html.text("↑")]), ]) ])); -- cgit v1.2.3