Skip to content

Commit 1be5c1a

Browse files
committed
convertDocumentToHTML now returns fragments
1 parent 5cf4ba1 commit 1be5c1a

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

lib/org/converter-html.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
var Node = require("./node.js").Node;
22

33
var HtmlTextConverter = {
4+
convertDocumentToHTML: function (doc, exportOptions) {
5+
var convertedDoc = this.convertDocument(doc, exportOptions);
6+
7+
return convertedDoc.titleHTML +
8+
convertedDoc.tocHTML +
9+
convertedDoc.this.tag("hr", null) +
10+
convertedDoc.contentHTML;
11+
},
12+
413
convertDocument: function (doc, exportOptions) {
514
this.documentOptions = doc.options || {};
615
this.exportOptions = exportOptions || {};
@@ -11,7 +20,15 @@ var HtmlTextConverter = {
1120
var contentHTML = this.convertNodes(doc.nodes, true /* record headers */);
1221
var tocHTML = this.generateToc(this.documentOptions["toc"]);
1322

14-
return titleHTML + tocHTML + this.tag("hr", null) + contentHTML;
23+
return {
24+
title: title,
25+
titleHTML: titleHTML,
26+
contentHTML: contentHTML,
27+
tocHTML: tocHTML,
28+
toString: function () {
29+
return titleHTML + tocHTML + contentHTML;
30+
}
31+
};
1532
},
1633

1734
initialize: function () {

0 commit comments

Comments
 (0)