highlightjs / highlight.js

JavaScript syntax highlighter with language auto-detection and zero dependencies.
https://highlightjs.org/
BSD 3-Clause "New" or "Revised" License
23.3k stars 3.52k forks source link

enh(typescript) add support for satisfies keyword #4058

Closed kisaragi-hiu closed 1 month ago

kisaragi-hiu commented 1 month ago

Changes

TypeScript added the satisfies operator in TypeScript 4.9, in November 2022. This PR adds support for it.

before after
A TypeScript sample with the satisfies and the as operators. "as" is highlighted while "satisfies" is not. The same TypeScript sample with the satisfies and the as operators. Both "as" and "satisfies" are highlighted.

Checklist

github-actions[bot] commented 1 month ago

Build Size Report

Changes to minified artifacts in /build, after gzip compression.

5 files changed

Total change +10 B

View Changes | file | base | pr | diff | | --- | --- | --- | --- | | es/core.min.js | 8.2 KB | 8.2 KB | -1 B | | es/highlight.min.js | 8.2 KB | 8.2 KB | -1 B | | es/languages/typescript.min.js | 3.16 KB | 3.17 KB | +7 B | | highlight.min.js | 8.23 KB | 8.23 KB | -2 B | | languages/typescript.min.js | 3.17 KB | 3.18 KB | +7 B |