diff --git a/src/lib/annotations/__tests__/annotatorUtil-test.js b/src/lib/annotations/__tests__/annotatorUtil-test.js index 3d3125b03..c331d4729 100644 --- a/src/lib/annotations/__tests__/annotatorUtil-test.js +++ b/src/lib/annotations/__tests__/annotatorUtil-test.js @@ -236,12 +236,12 @@ describe('lib/annotations/annotatorUtil', () => { describe('generateBtn()', () => { it('should return button node from specified details', () => { - const btn = generateBtn('class', 'title', 'content', 'type'); + const btn = generateBtn('class', 'title', document.createElement('div'), 'type'); expect(btn).to.have.class('bp-btn-plain'); expect(btn).to.have.class('class'); expect(btn).to.have.attribute('data-type', 'type'); expect(btn).to.have.attribute('title', 'title'); - expect(btn).to.have.text('content'); + expect(btn).to.contain.html(document.createElement('div')); }); }); diff --git a/src/lib/annotations/annotatorUtil.js b/src/lib/annotations/annotatorUtil.js index beaaddd8d..d0c7996df 100644 --- a/src/lib/annotations/annotatorUtil.js +++ b/src/lib/annotations/annotatorUtil.js @@ -286,7 +286,7 @@ export function generateBtn(className, title, content, dataType = '') { buttonEl.classList.add(CLASS_BUTTON); buttonEl.classList.add(className); buttonEl.title = title; - buttonEl.textContent = content; + buttonEl.innerHTML = content; buttonEl.setAttribute('data-type', dataType); return buttonEl; }