Skip to content

Add line breaks in MAML for examples content #770

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 16, 2025
Merged

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

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