(#3029) Modify the way "empty" headings are detected

This commit is contained in:
Nils Andresen 2022-09-16 11:27:37 +00:00 committed by nils-a
parent 3fb4d929d3
commit 6332549e1f
1 changed files with 2 additions and 2 deletions

View File

@ -87,7 +87,7 @@ export class SPService {
/* Traverse through all the Text web parts in the page */
canvasContent1JSON.map((webPart) => {
if (webPart.zoneGroupMetadata && webPart.zoneGroupMetadata.type === 1) {
const headingIsEmpty: boolean = webPart.zoneGroupMetadata.displayName === '';
const headingIsEmpty: boolean = !webPart.zoneGroupMetadata.displayName;
const headingValue: string = headingIsEmpty ? 'Empty Heading' : webPart.zoneGroupMetadata.displayName ;
const anchorUrl: string = this.GetAnchorUrl(headingValue);
this.allUrls.push(anchorUrl);
@ -104,7 +104,7 @@ export class SPService {
const hasCollapsableHeader: boolean = webPart.zoneGroupMetadata &&
webPart.zoneGroupMetadata.type === 1 &&
( anchorLinks.filter(x => x.name === webPart.zoneGroupMetadata.displayName).length === 1 ||
webPart.zoneGroupMetadata.displayName === '' );
!webPart.zoneGroupMetadata.displayName );
const htmlObject: HTMLDivElement = document.createElement('div');
htmlObject.innerHTML = HTMLString;