Skip to content

feat: explore syntastica for syntax highlighting #4

@zeon256

Description

@zeon256

Why

Currently we are using syntect which unfortunately does not support some language (TypeScript, TSX, JSX etc). Am thinking of moving to a tree-sitter based highlighter and syntastica looks pretty promising.

What has been explored

So far, a SyntasticaAdapter has been created and upon testing the following works

  • Rendering to HTML (requires 1 line change in example repo CSS)
  • Syntax are way more accurate
  • Has way more support for different languages

Problems

  • Wasm module is bigger despite only importing rust for testing compared to syntect
  • Performance is almost 100x slower, I tried using Lazy but it did not improve performance. Am not sure what's the best way to do this with comrak

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions