From 6bb08960ce155202049ab505cb456b740462a974 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Tue, 22 Apr 2014 19:02:00 +0100 Subject: Include style ID in warning --- lib/document-to-html.js | 5 ++++- tests/document-to-html.tests.js | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/document-to-html.js b/lib/document-to-html.js index bd3a3d6..4f38b9d 100644 --- a/lib/document-to-html.js +++ b/lib/document-to-html.js @@ -148,5 +148,8 @@ function DocumentConverter(options) { } function unrecognisedStyleWarning(type, element) { - return results.warning("Unrecognised " + type + " style: '" + element.styleName + "'"); + return results.warning( + "Unrecognised " + type + " style: '" + element.styleName + "'" + + " (Style ID: " + element.styleId + ")" + ); } diff --git a/tests/document-to-html.tests.js b/tests/document-to-html.tests.js index b6e3254..b9a8476 100644 --- a/tests/document-to-html.tests.js +++ b/tests/document-to-html.tests.js @@ -100,7 +100,7 @@ describe('DocumentConverter', function() { ]); var converter = new DocumentConverter(); return converter.convertToHtml(document).then(function(result) { - assert.deepEqual(result.messages, [results.warning("Unrecognised paragraph style: 'Heading 1'")]); + assert.deepEqual(result.messages, [results.warning("Unrecognised paragraph style: 'Heading 1' (Style ID: Heading1)")]); }); }); @@ -174,7 +174,7 @@ describe('DocumentConverter', function() { var run = runOfText("Hello.", {styleId: "Heading1Char", styleName: "Heading 1 Char"}); var converter = new DocumentConverter(); return converter.convertToHtml(run).then(function(result) { - assert.deepEqual(result.messages, [results.warning("Unrecognised run style: 'Heading 1 Char'")]); + assert.deepEqual(result.messages, [results.warning("Unrecognised run style: 'Heading 1 Char' (Style ID: Heading1Char)")]); }); }); -- cgit v1.2.3