diff --git a/packages/golden-layout/src/controls/DragProxy.ts b/packages/golden-layout/src/controls/DragProxy.ts index 00cf6c4a64..f2b1d0d8fc 100644 --- a/packages/golden-layout/src/controls/DragProxy.ts +++ b/packages/golden-layout/src/controls/DragProxy.ts @@ -90,7 +90,7 @@ export default class DragProxy extends EventEmitter { 'title', stripTags(this._contentItem.config.title ?? '') ); - this.element.find('.lm_title').html(this._contentItem.config.title ?? ''); + this.element.find('.lm_title').text(this._contentItem.config.title ?? ''); this.childElementContainer = this.element.find('.lm_content'); this.childElementContainer.append(contentItem.element); diff --git a/packages/golden-layout/src/controls/Tab.ts b/packages/golden-layout/src/controls/Tab.ts index 0704e9cdb9..245399d15a 100644 --- a/packages/golden-layout/src/controls/Tab.ts +++ b/packages/golden-layout/src/controls/Tab.ts @@ -98,7 +98,7 @@ export default class Tab { setTitle(title = '') { // Disabling for illumon project, we want to manage our own tooltips // this.element.attr( 'title', lm.utils.stripTags( title ) ); - this.titleElement.html(title); + this.titleElement.text(title); } /** diff --git a/packages/golden-layout/test/title-tests.js b/packages/golden-layout/test/title-tests.js index ca9a4f9c9e..e837e741a9 100644 --- a/packages/golden-layout/test/title-tests.js +++ b/packages/golden-layout/test/title-tests.js @@ -66,12 +66,11 @@ describe('content items are abled to to emit events that bubble up the tree', fu it('supports html in title', function () { itemWithTitle.container.setTitle('title with html'); expect(stack.header.tabs[0].element.find('.lm_title').html()).toBe( - 'title with html' + 'title <b>with</b> html' ); expect(stack.header.tabs[0].element.find('.lm_title').text()).toBe( - 'title with html' + 'title with html' ); - // expect( stack.header.tabs[ 0 ].element.attr( 'title' ) ).toBe( 'title with html' ); }); it('destroys the layout', function () {