highlightjs/highlight.js

(Dart) Highlight colors for Class and Constructor Calls

Open

#4.091 geöffnet am 13. Aug. 2024

Auf GitHub ansehen
 (4 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (3.497 Forks)batch import
buggood first issuehelp welcomelanguage

Repository-Metriken

Stars
 (22.960 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

Describe the issue

The current output lacks color for class names and constructor calls so most lines are displayed in the same color, which significantly impacts readability and makes it challenging to distinguish between different code components. In contrast

Which language seems to have the issue?

Dart (the issue is impacting Flutter)

Are you using highlight or highlightAuto?

highlight

...

Sample Code to Reproduce


import 'package:flutter/material.dart';

void main() {
  runApp(MaterialApp(
    home: Scaffold (
      appBar: AppBar(
        title: const Text('Scaffold Example'),
      ),
      body: const Center(
        child: Text('Hello, World!'),
      ),
      drawer: Drawer(
        child: ListView(
          children: const <Widget>[
            ListTile(title: Text('Home')),
            ListTile(title: Text('Profile')),
          ],
        ),
      ),
      bottomNavigationBar: BottomNavigationBar(
        items: const [
          BottomNavigationBarItem(icon: Icon(Icons.home), label: 'Home'),
          BottomNavigationBarItem(icon: Icon(Icons.search), label: 'Search'),
        ],
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: () {},
        child: Icon(Icons.add),
      ),
    ),
  ));
}

Expected behavior Highlight colors for Class and Constructor Calls

Additional context

Here are two images: (1) - displaying the current output from the Highlight library , where all elements appear in the same color, making it difficult to read. (2) - a different library, which shows custom colors for classes and constructors. Both images feature code written in Dart for Flutter.

highlight

other

Contributor Guide