aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/index.js4
-rw-r--r--tests/mammoth.tests.js4
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/index.js b/lib/index.js
index e2ff657..a07b409 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -13,7 +13,7 @@ exports.extractRawText = extractRawText;
exports.images = require("./images");
exports.transforms = require("./transforms");
exports.underline = require("./underline");
-exports.writeStyleMapToDocx = writeStyleMapToDocx;
+exports.embedStyleMap = embedStyleMap;
function convertToHtml(input, options) {
return convert(input, options);
@@ -89,7 +89,7 @@ function convertElementToRawText(element) {
}
}
-function writeStyleMapToDocx(input, styleMap) {
+function embedStyleMap(input, styleMap) {
return unzip.openZip(input)
.then(function(docxFile) {
docxStyleMap.writeStyleMap(docxFile, styleMap);
diff --git a/tests/mammoth.tests.js b/tests/mammoth.tests.js
index 64439f1..10ba228 100644
--- a/tests/mammoth.tests.js
+++ b/tests/mammoth.tests.js
@@ -81,11 +81,11 @@ describe('mammoth', function() {
});
});
- test('style map can be saved and read from document buffer', function() {
+ test('embedded style is used if present', function() {
var docxPath = path.join(__dirname, "test-data/single-paragraph.docx");
return promises.nfcall(fs.readFile, docxPath)
.then(function(buffer) {
- return mammoth.writeStyleMapToDocx({buffer: buffer}, "p => h1");
+ return mammoth.embedStyleMap({buffer: buffer}, "p => h1");
})
.then(function(docx) {
return mammoth.convertToHtml({buffer: docx.toBuffer()});