mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-06 08:18:53 +00:00
feat: Add MATLAB syntax highlighting support for code blocks (#20773)
* feat: Add MATLAB syntax highlighting support for code blocks Add MATLAB syntax highlighting support by fixing issues in both CodeEditor (editable) and CodeBlock (read-only) components. Changes: - CodeEditor.svelte: Added 'matlab' alias to CodeMirror's Octave language (MATLAB-compatible syntax) - CodeBlock.svelte: Fixed highlight.js usage to use highlight() directly when language is recognized, falling back to highlightAuto() only for unknown languages * revert: not needed
This commit is contained in:
parent
be75bc506a
commit
98cb2d3411
1 changed files with 6 additions and 0 deletions
|
|
@ -104,6 +104,12 @@
|
|||
})
|
||||
);
|
||||
|
||||
// Add 'matlab' alias to Octave language (MATLAB-compatible syntax)
|
||||
const octaveLang = languages.find((l) => l.name === 'Octave');
|
||||
if (octaveLang && !octaveLang.alias.includes('matlab')) {
|
||||
octaveLang.alias.push('matlab');
|
||||
}
|
||||
|
||||
const getLang = async () => {
|
||||
const language = languages.find((l) => l.alias.includes(lang));
|
||||
return await language?.load();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue