Skip to content

[WIP] Fix wildcard character preservation in XML documentation - #12547

Closed
Jorge Rangel (jorgerangel-msft) with Copilot wants to merge 1 commit into
mainfrom
copilot/http-client-csharp-preserve-wildcard-characters
Closed

Jorge Rangel (jorgerangel-msft) with Copilot wants to merge 1 commit into
mainfrom
copilot/http-client-csharp-preserve-wildcard-characters

Conversation

Copilot AI commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.


This section details on the original issue you should resolve

<issue_title>[http-client-csharp] Preserve wildcard characters inside Markdown code spans in XML documentation</issue_title>
<issue_description>## Description

The C# generator interprets asterisks inside Markdown code spans as italic delimiters, corrupting the literal values in generated XML documentation.

For example, the Redis Enterprise TypeSpec has this property documentation:

The Redis ACL permissions string applied to this assignment, for example `+@read ~cache:*`. Defaults to `+@all ~*` if not specified.

The generated C# XML documentation instead contains:

/// <summary> The Redis ACL permissions string applied to this assignment, for example `+@read ~cache:<i>`. Defaults to `+@all ~</i>` if not specified. </summary>

The * characters are part of Redis ACL key patterns; losing them makes the documented example and default incorrect.

Root cause

DocHelpers.ConvertInlineMarkdown applies ItalicRegex to the entire line without recognizing backtick-delimited code spans. It matches the first wildcard through the second and replaces them with <i> tags. Applying the existing regex to the input above reproduces the generated output exactly.

Expected behavior

Preserve the literal content of Markdown code spans, including *, when converting documentation to XML. Add regression tests for multiple code spans containing wildcards on one line, alongside ordinary italic formatting outside code spans. An end-to-end generated-property documentation test would also guard the observable output.

Context

- by copilot
</issue_description>

Comments on the Issue (you are Copilot in this section)

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
1 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

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.

[http-client-csharp] Preserve wildcard characters inside Markdown code spans in XML documentation

2 participants