Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b15c843

Browse files
author
William Chou
committedMay 21, 2021
Fix lint.
1 parent a608ede commit b15c843

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed
 

‎extensions/amp-list/0.1/amp-list.js

+10-4
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ import {dict, getValueForExpr} from '../../../src/core/types/object';
5252
import {getMode} from '../../../src/mode';
5353
import {getSourceOrigin, isAmpScriptUri} from '../../../src/url';
5454

55+
import {escapeCssSelectorIdent} from '../../../src/core/dom/css';
5556
import {isAmp4Email} from '../../../src/format';
5657
import {isArray, toArray} from '../../../src/core/types/array';
5758
import {isExperimentOn} from '../../../src/experiments';
@@ -322,12 +323,12 @@ export class AmpList extends AMP.BaseElement {
322323
/**
323324
* A "diffable placeholder" is the child container <div> (which is usually created by the amp-list
324325
* to hold the rendered children). It serves the same purpose as a placeholder, except it can be diffed.
325-
*
326+
*
326327
* For example:
327328
* <amp-list>
328329
* <div placeholder>I'm displayed before render.</div>
329330
* </amp-list>
330-
*
331+
*
331332
* <amp-list diffable>
332333
* <div role=list>I'm displayed before render.</div>
333334
* </amp-list>
@@ -336,11 +337,16 @@ export class AmpList extends AMP.BaseElement {
336337
* @private
337338
*/
338339
queryDiffablePlaceholder_() {
339-
const roleSelector = this.element.hasAttribute('single-item') ? '' : '[role=list]'
340+
const roleSelector = this.element.hasAttribute('single-item')
341+
? ''
342+
: '[role=list]';
343+
340344
return scopedQuerySelector(
341345
this.element,
342346
// Don't select other special <div> children used for placeholders/fallback/etc.
343-
`> div${roleSelector}:not([placeholder]):not([fallback]):not([fetch-error])`
347+
`> div${escapeCssSelectorIdent(
348+
roleSelector
349+
)}:not([placeholder]):not([fallback]):not([fetch-error])`
344350
);
345351
}
346352

0 commit comments

Comments
 (0)
Please sign in to comment.