Closed depthbomb closed 3 months ago
Describe the bug Given many code strings, using guess({ source: ... }) or guess_by_source(...) returns Rouge::Lexers::PlainText.
guess({ source: ... })
guess_by_source(...)
Rouge::Lexers::PlainText
To Reproduce
# frozen_string_literal: true require 'rouge' code = <<~CODE { "s": "t", "i": 123, "b": true } CODE formatter = Rouge::Formatters::HTMLInline.new(Rouge::Themes::Github.new) lexer = Rouge::Lexer.guess({ source: code }) # or Rouge::Lexer.guess_by_source(code) output = formatter.format(lexer.lex(code)) puts lexer.title puts output
Expected behavior Correctly guesses the lexer to use.
Screenshots None
System
Additional context I'm not sure if this is entirely a library bug or I'm attempting to use the code incorrectly as there wasn't much info about the usage regarding guessing by code source.
Describe the bug Given many code strings, using
guess({ source: ... })
orguess_by_source(...)
returnsRouge::Lexers::PlainText
.To Reproduce
Expected behavior Correctly guesses the lexer to use.
Screenshots None
System
Additional context I'm not sure if this is entirely a library bug or I'm attempting to use the code incorrectly as there wasn't much info about the usage regarding guessing by code source.