Skip to content

Commit bdd935e

Browse files
CopilotBillWagner
andauthored
Add documentation for missing HTML formatting tags in C# XML documentation (#47053)
* Initial plan * Add documentation for missing HTML formatting tags in XML documentation Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com>
1 parent 60df0ef commit bdd935e

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

docs/csharp/language-reference/xmldoc/recommended-tags.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,11 @@ The compiler verifies the syntax of the elements followed by a single \* in the
133133
- [`<c>`](#c)
134134
- [`<code>`](#code)
135135
- [`<example>`](#example) \*\*
136+
- [`<b>`](#b)
137+
- [`<i>`](#i)
138+
- [`<u>`](#u)
139+
- [`<br/>`](#br)
140+
- [`<a>`](#a)
136141
- [Reuse documentation text](#reuse-documentation-text) - These tags provide tools that make it easier to reuse XML comments.
137142
- [`<inheritdoc>`](#inheritdoc) \*\*
138143
- [`<include>`](#include) \*
@@ -303,6 +308,49 @@ This shows how to increment an integer.
303308

304309
The `<example>` tag lets you specify an example of how to use a method or other library member. An example commonly involves using the [\<code>](#code) tag.
305310

311+
### \<b>
312+
313+
```xml
314+
<b>text</b>
315+
```
316+
317+
The `<b>` tag is used to make text bold within documentation comments. This HTML formatting tag is validated by the compiler and Visual Studio, and the formatted text appears in IntelliSense and generated documentation.
318+
319+
### \<i>
320+
321+
```xml
322+
<i>text</i>
323+
```
324+
325+
The `<i>` tag is used to make text italic within documentation comments. This HTML formatting tag is validated by the compiler and Visual Studio, and the formatted text appears in IntelliSense and generated documentation.
326+
327+
### \<u>
328+
329+
```xml
330+
<u>text</u>
331+
```
332+
333+
The `<u>` tag is used to underline text within documentation comments. This HTML formatting tag is validated by the compiler and Visual Studio, and the formatted text appears in IntelliSense and generated documentation.
334+
335+
### \<br/>
336+
337+
```xml
338+
Line one<br/>Line two
339+
```
340+
341+
The `<br/>` tag is used to insert a line break within documentation comments. Use this tag when you want a single spaced paragraph, as opposed to the `<para>` tag which creates double spaced paragraphs.
342+
343+
### \<a>
344+
345+
```xml
346+
<a href="https://example.com">Link text</a>
347+
```
348+
349+
The `<a>` tag is used to create hyperlinks within documentation comments. The `href` attribute specifies the URL to link to. This HTML formatting tag is validated by the compiler and Visual Studio.
350+
351+
> [!NOTE]
352+
> The compiler also validates the `<tt>` tag, which is deprecated HTML. Use the [`<c>`](#c) tag instead for inline code formatting.
353+
306354
## Reuse documentation text
307355

308356
### \<inheritdoc>

0 commit comments

Comments
 (0)