Skip to content

Server-side syntax highlighting #7729

Closed
@silverwind

Description

@silverwind

Syntax highlighing is currently performed client-side which has a few drawbacks:

  • We need to ship a 700kB library to the client which hurts performance
  • There is a flash of unhighlighted code on every page load
  • Language detection of highlight.js does not work based on filenames but on the code itself, giving a lot of false highlights (we could probably fix by mapping more file extensions, thought).

It may be worth investigating integrating https://github.com/alecthomas/chroma as server-side highlight. It supports language detection based on filename out of the box.

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/confirmedIssue has been reviewed and confirmed to be present or accepted to be implementedtype/enhancementAn improvement of existing functionality

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions