feat: add C, C++, and Java syntax highlighting support
Add c, cpp, and java to the highlight.js language bundle for code block rendering. These are among the most commonly used languages in AI coding conversations and were previously unsupported, falling back to plain text. Also adds aliases: h (C headers), cc/cxx/c++/hpp/hxx (C++ variants).
This commit is contained in:
@@ -3,8 +3,8 @@ import hljs, { rehypeHighlightLanguages, rehypeHighlightOptions } from '../highl
|
||||
|
||||
describe('highlight', () => {
|
||||
const expectedLanguages = [
|
||||
'bash', 'css', 'diff', 'dockerfile', 'go', 'ini',
|
||||
'javascript', 'json', 'markdown', 'python', 'rust',
|
||||
'bash', 'c', 'cpp', 'css', 'diff', 'dockerfile', 'go', 'ini',
|
||||
'java', 'javascript', 'json', 'markdown', 'python', 'rust',
|
||||
'shell', 'sql', 'typescript', 'xml', 'yaml',
|
||||
];
|
||||
|
||||
@@ -17,7 +17,7 @@ describe('highlight', () => {
|
||||
});
|
||||
|
||||
it('resolves common aliases', () => {
|
||||
const aliases = ['sh', 'zsh', 'js', 'jsx', 'ts', 'tsx', 'py', 'html', 'yml', 'rs'];
|
||||
const aliases = ['sh', 'zsh', 'h', 'cc', 'cxx', 'js', 'jsx', 'ts', 'tsx', 'py', 'html', 'yml', 'rs'];
|
||||
for (const alias of aliases) {
|
||||
const lang = hljs.getLanguage(alias);
|
||||
expect(lang, `alias "${alias}" should resolve`).toBeDefined();
|
||||
|
||||
Reference in New Issue
Block a user