KEMBAR78
Add line breaks in MAML for examples content by adityapatwardhan · Pull Request #770 · PowerShell/platyPS · GitHub
Skip to content

Conversation

@adityapatwardhan
Copy link
Member

PR Summary

This pull request introduces a workaround to address an issue with line breaks not being preserved in MAML files during export. The changes include modifying the MAML file processing logic, adjusting how example descriptions are handled, and adding a test case to verify the workaround.

Changes to MAML file processing:

  • In src/Command/ExportMamlCommandHelp.cs, updated the EndProcessing method to read the generated MAML file, replace a placeholder (<maml:para>__REMOVE_ME_LINE_BREAK__</maml:para>) with a proper line break representation (<maml:para>&#x20;&#x08;</maml:para>), and write the updated content back to the file.

Changes to example description handling:

  • In src/MamlWriter/MamlHelpers.cs, updated the ConvertExample method to add a placeholder (__REMOVE_ME_LINE_BREAK__) for line breaks between example description items, ensuring proper formatting in the MAML output.

Test case addition:

  • In test/Pester/ExportMamlCommandHelp.Tests.ps1, added a test to verify that the exported MAML file contains the correct line break workaround (<maml:para>&#x20;&#x08;</maml:para>).

PR Context

Fixes #754

@adityapatwardhan
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Collaborator

@sdwheeler sdwheeler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@adityapatwardhan adityapatwardhan merged commit 8a82a4b into main Jul 16, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Restore line breaks between code and paragraphs in MAML

2 participants