diff options
| author | Michael Williamson <mike@zwobble.org> | 2015-10-14 19:17:07 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2015-10-14 19:17:07 +0100 |
| commit | e0397dcd7f650e86898ceab97eedc5753494d9f5 (patch) | |
| tree | e448fe8a0699e42756682d06a8b70e73a47c520e /lib/document-to-html.js | |
| parent | 46ad965f936563829a7c0549a5eb1af89155ee48 (diff) | |
Rename html.element to html.freshElement
Diffstat (limited to 'lib/document-to-html.js')
| -rw-r--r-- | lib/document-to-html.js | 24 |
1 files changed, 12 insertions, 12 deletions
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("↑")]), ]) ])); |
