Merge pull request #3030 from nils-a/feature/GH-3029

(#3029) Modify the way "empty" headings are detected
This commit is contained in:
Hugo Bernier 2022-11-07 09:57:54 -05:00 committed by GitHub
commit 64b745d7d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;