feat: add Markdown formatting support for step content in test plans#1402
Merged
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
krid-583
reviewed
Jul 7, 2026
krid-583
approved these changes
Jul 7, 2026
krid-583
approved these changes
Jul 7, 2026
aaudzei
approved these changes
Jul 8, 2026
aaudzei
left a comment
Contributor
There was a problem hiding this comment.
Approved with suggestion
| function formatStepContent(text: string): string { | ||
| // Convert Markdown markers to HTML tags (** before * and __ before _ to avoid conflicts) | ||
| const htmlContent = text | ||
| .replace(/\*\*(.+?)\*\*/g, "<B>$1</B>") |
Contributor
There was a problem hiding this comment.
unless there is a specific reason to use uppercase HTML tags I'd prefer more conventional <b>Text</b>
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.
This pull request enhances the formatting of test case steps in Azure DevOps by supporting Markdown-to-HTML conversion and ensuring proper XML-escaping for safe storage. It introduces a new helper function to handle the formatting and updates both the implementation and tests to verify correct behavior for various Markdown features and HTML escaping.
Formatting and Conversion Enhancements:
formatStepContentfunction insrc/tools/test-plans.tsto convert Markdown markers (bold, italic, inline code, and links) to corresponding HTML tags, wrap the result in the ADO rich text envelope, and XML-escape the final string for storage.convertStepsToXmlto useformatStepContentfor both step and expected result content, ensuring all step content is consistently formatted and escaped.Testing Improvements:
test/src/tools/test-plan.test.tsto verify that:<CODE>tags.<script>) are escaped and not rendered.GitHub issue number
#1399 1398
Associated Risks
N/A
✅ PR Checklist
🧪 How did you test it?
Updated tests and tested manually with success