can't find an easy way to implement c#

i’m trying to get this to work in my html page,

i can’t find the css styling anywhere else except if i take it from that website.


<!DOCTYPE html>
<html xmlns="">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>CodeMirror: C# demonstration</title>
    <link rel="stylesheet" type="text/css" href="">
    <style type="text/css" id="dark-mode-custom-link"></style>
    <style type="text/css" id="dark-mode-general-link"></style>
    <style lang="en" type="text/css" id="dark-mode-custom-style"></style>
    <style lang="en" type="text/css" id="dark-mode-native-style"></style>
    <style lang="en" type="text/css" id="dark-mode-native-sheet"></style>
<body style="padding: 20px;" data-new-gr-c-s-check-loaded="14.1162.0" data-gr-ext-installed="" data-new-gr-c-s-loaded="14.1162.0">

<div style="border-top: 1px solid black; border-bottom: 1px solid black;">
    <input type="text" id="code" style="display: none;">

<script src="" type="text/javascript"></script>
<script src="" type="text/javascript"></script>
<script src="" type="text/javascript"></script>

<script type="text/javascript">
    var editor = CodeMirror.fromTextArea(document.getElementById('code'), {
        parserfile: ["", ""],
        stylesheet: "",
        path: "",
        lineNumbers: true, // Add line numbers
        indentUnit: 4

    document.getElementById('addButton').addEventListener('click', function() {
        var name = document.getElementById('nameInput').value;
        var code = editor.getValue();
        console.log('Name:', name);
        console.log('C# Code:', code);


The /1/ in that URL indicates that this is CodeMirror version 1, 13 years out of date. To get passable C# highlighting in version 6, use the csharp export from @codemirror/legacy-modes with a StreamLanguage as shown on the example on that page.