git-touch / highlight.dart

Syntax highlighting for Dart and Flutter
https://git-touch.github.io/highlight/
MIT License
234 stars 85 forks source link

FormatException: when `language` is null and `autoDetection` is true #11

Open asjqkkkk opened 4 years ago

asjqkkkk commented 4 years ago

source code sample

import 'package:markdown_widget/config/highlight_themes.dart' as theme;

  Widget buildMarkdown() => MarkdownWidget(
        data: data,
        styleConfig: StyleConfig(
          preConfig: PreConfig(
            language: 'java',
            theme: theme.a11yLightTheme
          )
        ),
      );

usage

_convert(hi.highlight.parse(source, language: null, autoDetection: true)

error log

flutter: FormatException: Invalid number (at character 1)

^
flutter: FormatException: Invalid radix-10 number (at character 1)
=
^

flutter doctor

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.17.1, on Mac OS X 10.15.3 19D76, locale zh-Hans-CN)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.1)
[✓] Android Studio (version 3.6)
[✓] VS Code (version 1.43.1)
[✓] Connected device (1 available)