githuber-md icon indicating copy to clipboard operation
githuber-md copied to clipboard

Highlight 建議先將語法名稱轉小寫之後再映射

Open jakeuj opened this issue 4 years ago • 2 comments

如果沒有提供以下詳細資訊,您開立的問題回報會被無視。

問題或臭蟲

只有小寫 cs 可以正常語法高亮

如何重現

請告知重現此問題的步驟何:

  1. 程式碼區段使用大寫 ``` CS
using System.IO.Compression;

namespace MyApplication
{
    [Obsolete("...")]
    class Program : IInterface
    {
        public static List<int> JustDoIt(int count)
        {
            Span<int> numbers = stackalloc int[length];
            Console.WriteLine($"Hello {Name}!");
            return new List<int>(new int[] { 1, 2, 3 })
        }
    }
}

預期的行為或結果

無論大小寫 CS, CSharp, C# 皆可以正常語法高亮

畫面截圖

大寫CS

2021-02-18_14-46-53

2021-02-18_14-54-03

小寫 cs

2021-02-18_14-48-47

伺服器環境

  • WordPress 版本 5.6.1
  • WP Githuber MD 版本 1.16.0
  • PHP 版本 7.4 x86

用戶端環境

  • 作業系統 Win 10 20H2 19042.804
  • 瀏覽器 Chrome 版本 88.0.4324.182 (正式版本) (64 位元)

其它說明

  • 語法名稱先將轉小寫之後再映射
  • cs 加入 c# 與 csharp 名稱映射
  • 參照:Highlight.php

jakeuj avatar Feb 18 '21 06:02 jakeuj

python 也無法QQ

su81228 avatar Apr 12 '21 13:04 su81228

python 也無法QQ 你是輸入小寫 python 嗎?

'''python https://github.com/terrylinooo/githuber-md/blob/master/src/Modules/Highlight.php#L172

# src/hello.py
print("Hello world!")

jakeuj avatar Apr 13 '21 02:04 jakeuj

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 2 days.

github-actions[bot] avatar Jun 17 '23 00:06 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Jun 19 '23 00:06 github-actions[bot]