test: titles in project previews (#45051)
* fix: trim titles before injecting into iframes Surrounding whitespace isn't useful * test: check preview iframe has correct title
This commit is contained in:
committed by
GitHub
parent
44e2bce920
commit
5f06b7805c
@@ -213,7 +213,9 @@ export function updateProjectPreview(buildData, document) {
|
||||
const titleMatch = buildData?.sources?.index?.match(
|
||||
/<title>(.*?)<\/title>/
|
||||
);
|
||||
const frameTitle = titleMatch ? titleMatch[1] + ' preview' : 'preview';
|
||||
const frameTitle = titleMatch
|
||||
? titleMatch[1].trim() + ' preview'
|
||||
: 'preview';
|
||||
createProjectPreviewFramer(document, frameTitle)(buildData);
|
||||
} else {
|
||||
throw new Error(
|
||||
|
Reference in New Issue
Block a user