dotnet / dotnet/docfx

Code-snippet color issue in docfx v2.70.2

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

Description

**Describe the bug**
I have upgraded my docfx version 2.56.7 to the latest version v2.70.2. But in latest version the code-snippet section in the yml files is generated with the class="lang-csharp" for all the code-snippets even it is xml language. As checked it shows latest version by default it generates yml file lang as csharp by reading the code-snippets from xml documentation, so it affects the color of code-snippet.

**To Reproduce**
Steps to reproduce the behavior:
1. I have passed the dll and the xml documentation with code-snippets having both c# and the xml code in the src folder.
2. It generates yml file with lang-csharp for all files which then converts to html with less color effect as compared to older version due to it consider xml code as c# lang.

**Expected behavior**
I need to set the lang-xml for the xaml or xml language and set lang-csharp for C# language.

**Context (please complete the following information):**
- OS: Windows
- Docfx version: [2.70.2]

**Additional context**
Expected output (older version):
![image](https://github.com/dotnet/docfx/assets/97512284/96931196-1fb8-420d-98b0-e4d21863e586)

Actual Output (latest version):
![image](https://github.com/dotnet/docfx/assets/97512284/90bf256f-d178-4b99-ab8b-0543f2e5d584)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.