github / github/markup

Support language and diff highlighting together

Offen
#2,025 8 Kommentare 5 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Ruby
Sterne
6k
Forks
3.4k
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Support for both language and diff highlighting together is a popular feature request, as can be seen from the discussion https://github.com/github-linguist/linguist/discussions/5758 on the Linguist repo and [this Stack Overflow question](https://stackoverflow.com/questions/40883421/diff-syntax-highlighting-in-github-markdown).

This feature has already been implemented on other markdown-powered sites. The most straightforward syntax would be:

```diff
՝՝՝diff js
let fileIcon = document.querySelector("li.file-entry > span.icon");
+fileIcon.classList.remove("icon-file-text");
const disposable = addIconToElement(fileIcon, "/path/to/file.txt");
՝՝՝
```

Currently, this ignores the “js” part and only applies the “diff” syntax highlighting.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.