ConvertTo-PnPPage transformed text formatting issue
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 259
- Forks
- 161
- Avg merge
- 10h 33m
- Merged PRs (30d)
- 1
Description
### Reporting an Issue
Using PnP v 1.9.0 (PowerShell v 7.2.1) to convert an on-prem SharePoint 2013 publishing pages to modern equivalent in SPO we are seeing issues with the text formatting after conversion.
Expected behaviour
Transformed text retains original formatting
Actual behaviour
Converted text has a carriage return at the beginning of the text which is not present in the source. In addition we are seeing different sizes of text (on some pages) and/or removed carriage returns between paragraph's on others.
Interestingly, the missing carriage returns/text sizes are sometimes reinstated if the page is put into edit mode and then published. Please see below:
Source SP2013 page

Transformed SPO page

Transformed SPO page when put into edit:

Steps to reproduce behaviour
$target = Connect-PnPOnline https://domain.sharepoint.com/sites/site -ReturnConnection
$source = Connect-PnPOnline http://sourcesite -Credentials (Get-Credential) -ReturnConnection -TransformationOnPrem
ConvertTo-PnPPage -Identity "pagename.aspx" -PublishingPage -TargetConnection $target -Connection $source
PowerShell versions
PnP.Powershell 1.9.0, PowerShell 7.2.1
Operating system
Windows 10, version 1809 (OS Build 17763.379)
PS - Many thanks for all the useful information/help provided thus far.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reported ConvertTo-PnPPage command and compare the source SharePoint 2013 page with the transformed SPO page, including the behavior after entering edit mode and publishing. Trace the page transformation entry point and identify how text formatting, leading carriage returns, paragraph breaks, and text sizes are transferred. Done means converted pages retain the source formatting without requiring a subsequent edit and publish.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, powershell
- Domain
- content
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100