diff --git a/src/compiler/compile/utils/__test__.ts b/src/compiler/compile/utils/__test__.ts index 169d3aa920..1ee5e8477b 100644 --- a/src/compiler/compile/utils/__test__.ts +++ b/src/compiler/compile/utils/__test__.ts @@ -7,7 +7,6 @@ import { has_contenteditable_attr, is_name_contenteditable, get_contenteditable_attr, - CONTENTEDITABLE_ATTR, CONTENTEDITABLE_BINDINGS, } from './contenteditable'; import Element from '../nodes/Element'; @@ -43,7 +42,7 @@ describe('contenteditable', () => { assert.equal(is_contenteditable(node), false); }); it('returns true if node is not input or textarea AND it is contenteditable', () => { - const attr = { name: CONTENTEDITABLE_ATTR } as Attribute; + const attr = { name: 'contenteditable' } as Attribute; const node = { name: 'a', attributes: [attr] } as Element; assert.equal(is_contenteditable(node), true); }); @@ -66,7 +65,7 @@ describe('contenteditable', () => { describe('is_attr_contenteditable', () => { it('returns true if attribute is contenteditable', () => { - const attr = { name: CONTENTEDITABLE_ATTR } as Attribute; + const attr = { name: 'contenteditable' } as Attribute; assert.equal(is_attr_contenteditable(attr), true); }); it('returns false if attribute is not contenteditable', () => { @@ -78,7 +77,7 @@ describe('contenteditable', () => { describe('has_contenteditable_attr', () => { it('returns true if attribute is contenteditable', () => { - const attr = { name: CONTENTEDITABLE_ATTR } as Attribute; + const attr = { name: 'contenteditable' } as Attribute; const node = { attributes: [attr] } as Element; assert.equal(has_contenteditable_attr(node), true); }); @@ -100,7 +99,7 @@ describe('contenteditable', () => { describe('get_contenteditable_attr', () => { it('returns the contenteditable Attribute if it exists', () => { - const attr = { name: CONTENTEDITABLE_ATTR } as Attribute; + const attr = { name: 'contenteditable' } as Attribute; const node = { name: 'div', attributes: [attr] } as Element; assert.equal(get_contenteditable_attr(node), attr); }); diff --git a/src/compiler/compile/utils/contenteditable.ts b/src/compiler/compile/utils/contenteditable.ts index 0f186ea521..303baef67d 100644 --- a/src/compiler/compile/utils/contenteditable.ts +++ b/src/compiler/compile/utils/contenteditable.ts @@ -1,10 +1,7 @@ -// Utilities for managing contenteditable nodes +// Utilities for managing contenteditable nodes import Attribute from '../nodes/Attribute'; import Element from '../nodes/Element'; - -export const CONTENTEDITABLE_ATTR = 'contenteditable'; - export const CONTENTEDITABLE_BINDINGS = [ 'textContent', 'innerHTML', @@ -24,7 +21,7 @@ export function is_input_or_textarea(node: Element): boolean { * @param {Attribute} attribute A node.attribute */ export function is_attr_contenteditable(attribute: Attribute): boolean { - return attribute.name === CONTENTEDITABLE_ATTR; + return attribute.name === 'contenteditable'; } /**