Skip to content

Use double quotes in YAML if text contains single quote #749

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
Jun 23, 2025

Conversation

adityapatwardhan
Copy link
Member

PR Summary

This pull request improves YAML handling in related links and adds a new test case and asset for verifying the changes. The most important changes include fixing issues with single quotes in YAML output, adding a test to ensure the fix works as expected, and introducing a new markdown file for testing purposes.

Improvements to YAML handling:

  • Updated WriteRelatedLinks in src/YamlWriter/CommandHelpYamlWriter.cs to handle single quotes in LinkText by dynamically choosing between single or double quotes for YAML formatting.

Enhancements to test coverage:

  • Added a new test case in test/Pester/ExportYamlCommandHelp.Tests.ps1 to verify that related links' text with single quotes are correctly preserved in the YAML output.

New test asset:

  • Introduced a new markdown file, test/Pester/assets/Remove-SqlSensitivityClassification.md, to serve as a test asset for the Export-YamlCommandHelp functionality. This file includes detailed metadata, syntax, examples, and related links for the Remove-SqlSensitivityClassification cmdlet.

PR Context

Fixes #747

@adityapatwardhan
Copy link
Member Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@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 125e1ef into v2 Jun 23, 2025
8 checks passed
@adityapatwardhan adityapatwardhan deleted the SingleQuoteLink branch June 23, 2025 21:33
@adityapatwardhan adityapatwardhan changed the title Single quote link Use double quotes in YAML if text contains single quote Jun 23, 2025
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.

2 participants