Closed ericpskl closed 3 years ago
Known bug that I need to fix. All text are wrapped in a P element when being added via the API, but when there a H then that's not needed. The extra P causes the line break you see I think
Thanks @jansenbe
@ericpskl : just fixed this one, will be part of the next nightly of PnP Framework and PnP PowerShell
Thanks @jansenbe !!!
Summary of issue:
When creating or updating a SharePoint Online page using Invoke-PnPSiteTemplate, an extra line of whitespace is added above "Heading 1" text.
Version:
Steps to reproduce:
Create a new Modern page in SharePoint online. Add a single Text web part, with one line of text formatted as Heading 1.
Export this page to XML:
Export-PnPPage -Identity Test-Page-12345.aspx -Out Test-Page-12345.xml -Force
Inspect the XML template and confirm that there is no extra blank line present in the webpart's XML:
<pnp:CanvasControlProperty Key="Text" Value="<h2>There is no whitespace before this sentence (Heading 1)</h2><p><br></p>" />
Apply the XML as a template (this will overwrite the page):
Invoke-PnPSiteTemplate -Path .\Test-Page-12345.xml
Load the page and observe that a blank line has been inserted above the "Heading 1" formatted text. (It is easier to see the extra space by going into Edit mode on the page)
Any suggestions appreciated!