dotnet / dotnet/docfx

[Bug] Pipe tables do not render escaped code correctly

Open
#11,083 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
4.4k
Forks
890
Avg merge
2h 9m
Merged PRs (30d)
11

Description

**Describe the bug**
Pipe tables are not rendering code block regex correctly, based on the vscode, github and other markdown viewer experiences. Escaped characters are not getting escaped.

**To Reproduce**
Create a markdown file with this content:

```
| name | regex |
|-------------|---------|
| test | `^\d{3}-\d{3}-\d{3}-\d{3}$\|^\d{3}-\d{3}-\d{3}-\d{5}$` |
```

**Expected behavior**
The regex output should not show ```$\|``` for example the correct output should look like:

Image

**Context (please complete the following information):**
- OS: Windows
- Docfx version: 2.78.4

**Additional context**
Add any other context about the problem here.

Contributor guide

Open the contributing guide

Research direction

Reproduce the supplied pipe-table Markdown in Docfx 2.78.4 and trace the Markdown table-rendering path; no source file or test is named in the issue. Done means the escaped pipe in the inline regex renders without the extra `$\|` text, with a regression test covering the example.

Written by the indexing model from the issue text.

Assessment

Tech stack
markdown
Domain
documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.