Skip to content

Commit 35e291d

Browse files
committed
Fix that "Objective-C"(uppercased) code is not highlighted
1 parent 69f9d4b commit 35e291d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Core/Sources/SuggestionWidget/SyntaxHighlighting.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ func highlightedCodeBlock(
7777
return formatted
7878
default:
7979
var language = language
80-
if language == "objective-c" {
80+
// Workaround: Highlightr uses a different identifier for Objective-C.
81+
if language.lowercased().hasPrefix("objective"), language.lowercased().hasSuffix("c") {
8182
language = "objectivec"
8283
}
8384
func unhighlightedCode() -> NSAttributedString {

0 commit comments

Comments
 (0)