Forum syntax highlighting for C# and C++ is falling back to C (1 Viewer)

ajs

Development Group
  • Team MediaPortal
  • February 29, 2008
    12,120
    6,888
    Kyiv
    Ukraine Ukraine
    Country flag
    @high
    It does not help?
    https://xenforo.com/community/threads/geshi-syntax-highlighter.21903/#post-276543
    Change in editor_dialog_code template:
    from:
    Code:
    <option value="code=C++">C++</option>
    <option value="code=C#">C#</option>
    to
    Code:
    <option value="code=cpp">C++</option>
    <option value="code=csharp">C#</option>
    ? :whistle::coffee:

    there is no highlighting for strings
    I think they can be added. We should see the code as it is highlighted in the C and do here as well.
    https://github.com/GeSHi/geshi-1.1/tree/master/geshi/languages/csharp
     
    Last edited by a moderator:

    Vasilich

    Test Group
  • Team MediaPortal
  • August 30, 2009
    3,393
    1,170
    Germany, Mayence
    Russian Federation Russian Federation
    Country flag
    • Thread starter
    • Moderator
    • #16
    C#:
    using System;
    using System.IO;
    // comment
    /* more
      multiline
      comment */
    #pragma warning disable 414, 3021
    public class Program
    {
      /// <summary>The entry point to the program.</summary>
      public static int Main(string[] args)
      {
      Console.WriteLine("Hello, World!");
      string s = @"This
    ""string""
    spans
    multiple
    lines!";
      dynamic x = new ExpandoObject();
      x.MyProperty = 2; X = 0b01010001 + 44L;
      return 0xFF;
      }
    }
    async Task<int> AccessTheWebAsync()
    {
      string urlContents = await getStringTask;
      return urlContents.Length;
    }
    internal static void ExceptionFilters()
    {
      try
      {
      throw new Exception();
      }
      catch (Exception e) when (e.Message == "My error") { }
    }
    C++:
    #include <iostream>
    #define IABS(x) ((x) < 0 ? -(x) : (x))
    int main(int argc, char *argv[]) {
      /* An annoying "Hello World" example */
      for (auto i = 0; i < 0xFFFF; i++)
      cout << "Hello, World!" << endl;
      char c = '\n';
      unordered_map <string, vector<string> > m;
      m["key"] = "\\\\"; // this is an error
      return -2e3 + 12l;
    }
    fine, works
     
    Last edited:

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    12,120
    6,888
    Kyiv
    Ukraine Ukraine
    Country flag
    fine, works
    It is necessary to alter the string coloring for C#.

    I can not download this plugin to look like there and what works. If someone will give him, I look, at the same time highlighting washes correct.
     
    Last edited by a moderator:

    Vasilich

    Test Group
  • Team MediaPortal
  • August 30, 2009
    3,393
    1,170
    Germany, Mayence
    Russian Federation Russian Federation
    Country flag
    • Thread starter
    • Moderator
    • #19
    @high can you set those strings to other themes also?
    and please replace geshi/csharp.php with attached one :)
     

    Attachments

    Users Who Are Viewing This Thread (Users: 0, Guests: 1)

    OP Similar threads Forum Replies Date
    Rob Hexenmeister Conditional syntax General Support 7
    Similar threads

    Top Bottom