mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-13 07:40:59 +00:00
test(rtl): read rtl.css selectors with their white space folded
Prettier breaks the arrow rule's long selector over lines, so the literal look-up found no rule and FE-RTL-CSS-003 failed after the file was formatted.
This commit is contained in:
@@ -15,7 +15,8 @@ function ruleBody(...parts: string[]): string {
|
||||
for (const chunk of css.split('}')) {
|
||||
const open = chunk.indexOf('{');
|
||||
if (open < 0) continue;
|
||||
const head = chunk.slice(0, open);
|
||||
// Prettier breaks a long selector over lines; compared with its white space folded.
|
||||
const head = chunk.slice(0, open).replace(/\s+/g, ' ');
|
||||
if (parts.every((part) => head.includes(part))) return chunk.slice(open + 1);
|
||||
}
|
||||
return '';
|
||||
|
||||
Reference in New Issue
Block a user