CodeMirror C# Highlighting

前提是你 提交于 2019-12-24 13:43:02

问题


I am trying to highlight c-sharp with Code Mirror. Everything but the syntax highlight works. I am using .ASPX pages to delivery the content.

    <asp:TextBox runat="server" ID="codeBox" TextMode="multiline" Rows="30" Width="1000"></asp:TextBox>
      <script type="text/javascript">
        var editor = CodeMirror.fromTextArea(
                        document.getElementById("MainPagePlaceholder_codeBox"), 
                           { lineNumbers: true, matchBrackets: true, mode: "text/x-csrc" }
                        );

      </script>

I have the following stylesheets added:

<link href="codemirror.css" rel="stylesheet" type="text/css"/>
<link href="neat.css" rel="stylesheet" type="text/css"/>
<script src="/Scripts/mirror/clike.js"></script>
<script src="/Scripts/mirror/codemirror.js"></script>
<script src="/Scripts/mirror/matchbrackets.js"></script>

回答1:


I figured it out. I was able to resolve this issue: codemirror.js needs to be first before clike.js.



来源:https://stackoverflow.com/questions/17837538/codemirror-c-sharp-highlighting

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!