@@ -139,10 +139,15 @@ module.exports = {
139139 return true ;
140140 }
141141
142- // Check contenteditable
143- const ce = getTextAttr ( node , 'contenteditable' ) ;
144- if ( ce && ce !== 'false' ) {
145- return true ;
142+ // Check contenteditable. Per HTML spec, valid keywords are "true",
143+ // "false", "plaintext-only", and the empty string (which is the default
144+ // state, equivalent to "true"). So the attribute enables editing unless
145+ // its value is "false".
146+ if ( hasAttr ( node , 'contenteditable' ) ) {
147+ const ce = getTextAttr ( node , 'contenteditable' ) ;
148+ if ( ce === undefined || ce === null || ce . trim ( ) . toLowerCase ( ) !== 'false' ) {
149+ return true ;
150+ }
146151 }
147152
148153 // <object usemap> — not in HTML §3.2.5.2.7 but upstream ember-template-lint
@@ -175,9 +180,11 @@ module.exports = {
175180 if ( role && INTERACTIVE_ROLES . has ( role ) ) {
176181 return false ;
177182 }
178- const ce = getTextAttr ( node , 'contenteditable' ) ;
179- if ( ce && ce !== 'false' ) {
180- return false ;
183+ if ( hasAttr ( node , 'contenteditable' ) ) {
184+ const ce = getTextAttr ( node , 'contenteditable' ) ;
185+ if ( ce === undefined || ce === null || ce . trim ( ) . toLowerCase ( ) !== 'false' ) {
186+ return false ;
187+ }
181188 }
182189 if ( ( tag === 'img' || tag === 'object' ) && hasAttr ( node , 'usemap' ) ) {
183190 return false ;
0 commit comments