Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 17, 2026

C# XML documentation doesn't support markdown syntax. The emitter was generating markdown (**bold**, *italic*, - bullets) in XML doc comments, causing incorrect rendering in IntelliSense and documentation tools.

Changes

DocHelpers.cs

  • Added ConvertMarkdownToXml() to transform markdown syntax to XML tags
  • Converts inline formatting: **bold**<b>, *italic*<i>, ***both***<b><i>
  • Converts lists: - item<list type="bullet">, 1. item<list type="number">

XmlDocStatement.cs

  • Extended SkipValidTag() to recognize converted XML tags (<b>, <i>, <list>, <item>, <description>)
  • Prevents escaping of generated XML documentation tags

DocHelpersTests.cs

  • Added 16 test cases covering all conversion scenarios

Example

Before:

/// <summary>
/// Bullet point with **bold text**.
/// - One: description
/// - Two: description
/// </summary>

After:

/// <summary>
/// Bullet point with <b>bold text</b>.
/// <list type="bullet"><item><description>One: description</description></item><item><description>Two: description</description></item></list>
/// </summary>
Original prompt

This section details on the original issue you should resolve

<issue_title>Adopt Documentation spector scenarios</issue_title>
<issue_description>https://github.com/microsoft/typespec/tree/main/packages/http-specs/specs/documentation</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
Copilot AI changed the title [WIP] Adopt documentation spector scenarios Add C# tests for Documentation spector scenarios Jan 17, 2026
Copilot AI requested a review from JoshLove-msft January 17, 2026 18:33
Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
Copilot AI changed the title Add C# tests for Documentation spector scenarios Convert markdown to XML documentation syntax in C# emitter Jan 17, 2026
@JoshLove-msft JoshLove-msft marked this pull request as ready for review January 17, 2026 19:44
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.

Adopt Documentation spector scenarios

2 participants