[BUG]: Set-PnPPage and Set-PnPPageTextPart is adding extra white spaces above and below of text when text web part content ends with a Line break in Modern SharePoint page #4740
Labels
bug
Something isn't working
Reporting an Issue
Using Set-PnPPage to create the pages in multi-languages of SharePoint site and Set-PnPPageTextPart to update the content of a text web part on a modern SharePoint page. Which adding extra white spaces in text webpart just above the text and below.
Expected behavior
Actual behavior
It is adding extra white space just above and below the text in text web part.
Steps to reproduce behavior
The publishing works fine if no new line (line break) are added to the content in the end.
$siteURL = ""
$listName = "”
$identity = ""
$baseUri = ""
$appId = ""
$appSec = ""
Connect-PnPOnline $SiteURL -ClientId $appId -ClientSecret $appSec
Set-PnPPage -Identity $identity -Publish
}
Catch {
Log-Message "An unhandled exception occurred. Error: $_" -level "ERROR"
}
finally {
Write-Host "Done!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
}
Additional Info:
Updating the Text part content also adds extra paragraph tags (
) above and below the contentSet-PnPPageTextPart -Page $pageIdentity -InstanceId $textControl.InstanceId -Text $translatedControlText -ErrorAction Stop
What is the version of the Cmdlet module you are running?
PnP.PowerShell 2.99.89-nightly
Which operating system/environment are you running PnP PowerShell on?
Azure Functions
The text was updated successfully, but these errors were encountered: