Skip to content

Commit

Permalink
fixup! fix(material/tabs): allow both foreground and background color…
Browse files Browse the repository at this point in the history
…s to be set (#26212)
  • Loading branch information
wagnermaciel committed Dec 9, 2022
1 parent cde7bd3 commit d5be5d9
Showing 1 changed file with 2 additions and 7 deletions.
Expand Up @@ -158,11 +158,6 @@ export function updateAttribute(
const prefix = html.slice(0, index);
const suffix = html.slice(index);
const attrText = newValue ? `${name}="${newValue}"` : `${name}`;

if (node.startSourceSpan.start.line === node.startSourceSpan.end.line) {
return `${prefix} ${attrText}${suffix}`;
}

const indentation = parseIndentation(html, node);
return prefix + indentation + attrText + suffix;
}
Expand All @@ -174,13 +169,13 @@ function parseIndentation(html: string, node: TmplAstElement): string {
// Starting after the start source span's tagname,
// read and store each char until we reach a non-whitespace char.

for (let i = startOffset; i < html.length - 1; i++) {
for (let i = startOffset; i < node.startSourceSpan.end.offset - 1; i++) {
if (!/\s/.test(html.charAt(i))) {
break;
}
whitespace += html.charAt(i);
}
return whitespace;
return whitespace || ' ';
}

/**
Expand Down

0 comments on commit d5be5d9

Please sign in to comment.