Drift icon indicating copy to clipboard operation
Drift copied to clipboard

Display after saving and more syntax highlighting

Open XeroxDev opened this issue 3 years ago • 2 comments

Describe the bug I noticed that uploaded files are no longer displayed correctly. No syntax highlighting and no more new lines.

I also noticed the syntax highlighting isn't that good overall. Some languages are not supported entirely (CSharp) and others have just two colors (js, json). Would be nice if the syntax highlighting is like in github.

To Reproduce Steps to reproduce the behavior:

  1. Upload a file (I've tested it with a simple hello world c# file)
  2. save it

Expected behavior Preview should display it correctly. (Syntax highlighting, new lines and so on)

Screenshots CSharp File (Preview) image CSharpFile (RAW) image Json File (Preview) image Json File (RAW) image

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser firefox
  • Version 100.0

Additional context Code to copy

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello, world!");
            Console.ReadLine();
        }
    }
}
{
  "Hello": "World",
  "Integer": 123.45,
  "BoolTrue": true,
  "BoolFalse": false
}

XeroxDev avatar May 09 '22 09:05 XeroxDev

bump

XeroxDev avatar Jun 24 '22 11:06 XeroxDev

I'm currently in the process of refactoring Drift and improved highlighting is one of my goals. It's an easy fix -- the current code strips out styles because I intended to add them on the client.

MaxLeiter avatar Jun 26 '22 21:06 MaxLeiter