🪲 [Fix]: Example titles retain punctuation, numbering, and text - #864
Open
Marius Storhaug (MariusStorhaug) wants to merge 2 commits into
Open
🪲 [Fix]: Example titles retain punctuation, numbering, and text#864Marius Storhaug (MariusStorhaug) wants to merge 2 commits into
Marius Storhaug (MariusStorhaug) wants to merge 2 commits into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
8 tasks
Marius Storhaug (MariusStorhaug)
marked this pull request as ready for review
September 5, 2026 20:23
Marius Storhaug (MariusStorhaug)
requested review from
Aditya Patwardhan (adityapatwardhan) and
Sean Wheeler (sdwheeler)
as code owners
September 5, 2026 20:23
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Example titles now retain punctuation, numbering, and embedded
Example N:text when you import help and generate Markdown, YAML, or MAML. Titled and untitled examples continue to work together without changes to your authoring workflow.Fixed: Example titles no longer lose meaningful text
Trailing dashes and text that resembles an example heading are preserved instead of being removed during import.
Title ending in -Title ending inTitle ending in -Compare Example 4: with Example 5Compare with Example 5Compare Example 4: with Example 5Headings also retain their existing example numbers, including unbordered headings such as
Example 9: An unbordered heading -. Localized headings, single examples, and mixed titled/untitled examples remain supported.No migration or new parameters are required. Authoring
.EXAMPLE <Title>requires a PowerShell version containing PowerShell/PowerShell#27387; this fix does not raise platyPS's minimum supported PowerShell version.Technical details
Implementation
TransformBase.GetExamplesandTransformMaml.ReadExampleshareTransformUtils.GetExampleTitle.Example N:text. It replaces broad dash trimming and global string replacement.Tests and results
The build completes with no warnings or errors. Repository tests use Pester 4.10.1. The exact upstream runtime is PowerShell/PowerShell#27387 at commit
74aba26f15d1ce18e5ff7eee99c4b8a60e604335(PowerShell 7.7.0-preview.4).Regression coverage exercises 17 title cases through live
Get-Help, MAML import, and Markdown/YAML/MAML export. It includes punctuation, embedded example labels, numbering, localized labels, legacy variable-width borders, and unbordered titles. Four additional cases exercise real comment-based help, including a single line-comment example and mixed titled/untitled examples. These cases detect the upstreamCommentHelpInfo.ExampleTitlescapability rather than assuming a release version.Before the fix, 36 of the original 52 regression tests failed. All 56 regression tests now pass on the supporting runtime. In the original sample-module experiment, all 10 example headings now survive exactly through Markdown, YAML, and MAML export, compared with 8/10 using published platyPS 1.0.3. All example code is retained.
Known, separate failure: reimporting platyPS-generated MAML containing empty example-remarks elements still raises an
XmlException. This also occurs with published platyPS on stock PowerShell. It is the integration experiment's sole remaining failure; all title-preservation assertions pass. This PR does not change that parser behavior.Standards and framework alignment
src/Transform/*.cstest/Pester/ExampleTitles.Tests.ps1Issue scope is limited to #627 and PowerShell/PowerShell#27387. No additional issue closures are claimed.
This change is
Relevant issues (or links)
Related work