diff --git a/packages/ace-core/src/scripts/ace-extraction.js b/packages/ace-core/src/scripts/ace-extraction.js index 8857f08c..5671ad66 100644 --- a/packages/ace-core/src/scripts/ace-extraction.js +++ b/packages/ace-core/src/scripts/ace-extraction.js @@ -137,7 +137,7 @@ ace.getHeadings = function() { hxElems.forEach(function(hx) { headings.push({ - html: hx.innerHTML, + html: hx.textContent, level: +hx.localName.slice(1) }); }); diff --git a/packages/ace-core/src/scripts/ace-extraction.test.js b/packages/ace-core/src/scripts/ace-extraction.test.js index 7bce8e68..10986110 100644 --- a/packages/ace-core/src/scripts/ace-extraction.test.js +++ b/packages/ace-core/src/scripts/ace-extraction.test.js @@ -187,13 +187,20 @@ describe('extracting epub:trigger', () => { }); }); -describe('extracting headings', () => { +describe.only('extracting headings', () => { test('simple h1', async () => { const results = await run('getHeadings', '