Skip to content

Commit d5be5d9

Browse files
committed
fixup! fix(material/tabs): allow both foreground and background colors to be set (#26212)
1 parent cde7bd3 commit d5be5d9

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/material/schematics/ng-generate/mdc-migration/rules/tree-traversal.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,6 @@ export function updateAttribute(
158158
const prefix = html.slice(0, index);
159159
const suffix = html.slice(index);
160160
const attrText = newValue ? `${name}="${newValue}"` : `${name}`;
161-
162-
if (node.startSourceSpan.start.line === node.startSourceSpan.end.line) {
163-
return `${prefix} ${attrText}${suffix}`;
164-
}
165-
166161
const indentation = parseIndentation(html, node);
167162
return prefix + indentation + attrText + suffix;
168163
}
@@ -174,13 +169,13 @@ function parseIndentation(html: string, node: TmplAstElement): string {
174169
// Starting after the start source span's tagname,
175170
// read and store each char until we reach a non-whitespace char.
176171

177-
for (let i = startOffset; i < html.length - 1; i++) {
172+
for (let i = startOffset; i < node.startSourceSpan.end.offset - 1; i++) {
178173
if (!/\s/.test(html.charAt(i))) {
179174
break;
180175
}
181176
whitespace += html.charAt(i);
182177
}
183-
return whitespace;
178+
return whitespace || ' ';
184179
}
185180

186181
/**

0 commit comments

Comments
 (0)