Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Number sign (#) breaks java highlighting #36

Open
alexeyinkin opened this issue Aug 3, 2022 · 0 comments
Open

Number sign (#) breaks java highlighting #36

alexeyinkin opened this issue Aug 3, 2022 · 0 comments

Comments

@alexeyinkin
Copy link

For this input:

class MyClass {
}

we get the correct result:

image

Add a number sign:

class MyClass {
}#

and nothing is parsed:

image

Note that language is also null although java is explicitly passed.

Code
import 'package:highlight/highlight_core.dart';
import 'package:highlight/languages/java.dart';

void main() {
  highlight.registerLanguage('java', java);

  const text = '''
class MyClass {
}
''';
  final result = highlight.parse(text, language: 'java');
  print(result.nodes);

  const textNumber = '''
class MyClass {
}#
''';
  final resultNumber = highlight.parse(textNumber, language: 'java');
  print(resultNumber.nodes);
}
Output
[Instance of 'Node', Instance of 'Node', Instance of 'Node']
[Instance of 'Node']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant