fix(upgrade): fix transclusion on upgraded components (#17971)
Previously, only simple, single-slot transclusion worked on upgraded components. This commit fixes/adds support for the following: - Multi-slot transclusion. - Using fallback content when no transclusion content is provided. - Destroy unused scope (when using fallback content). Fixes #13271
This commit is contained in:

committed by
Jason Aden

parent
227dbbcfba
commit
67e9c62013
@ -20,9 +20,10 @@ export function html(html: string): Element {
|
||||
return div;
|
||||
}
|
||||
|
||||
export function multiTrim(text: string | null | undefined): string {
|
||||
export function multiTrim(text: string | null | undefined, allSpace = false): string {
|
||||
if (typeof text == 'string') {
|
||||
return text.replace(/\n/g, '').replace(/\s\s+/g, ' ').trim();
|
||||
const repl = allSpace ? '' : ' ';
|
||||
return text.replace(/\n/g, '').replace(/\s+/g, repl).trim();
|
||||
}
|
||||
throw new Error('Argument can not be undefined.');
|
||||
}
|
||||
|
Reference in New Issue
Block a user