From 96efe28341c087fe4d4e0f2360043b7a632ea562 Mon Sep 17 00:00:00 2001 From: Alexander Weiss Date: Mon, 5 Aug 2019 11:31:04 +0200 Subject: [PATCH] Use Text::Whitespace token in Console lexer (#894) The Console lexer uses the `Text` token for the whitespace between the console prompt character and the text that begins the command on a particular line. Using `Text::Whitespace` is more expressive and allows users to do things like define CSS rules that disable selection. --- lib/rouge/lexers/console.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rouge/lexers/console.rb b/lib/rouge/lexers/console.rb index e7fbaec6ee..b5c3d3efd5 100644 --- a/lib/rouge/lexers/console.rb +++ b/lib/rouge/lexers/console.rb @@ -116,7 +116,7 @@ def process_line(input, &output) # before we pass to the lang lexer so it can determine where # the "real" beginning of the line is $' =~ /\A\s*/ - yield Text, $& unless $&.empty? + yield Text::Whitespace, $& unless $&.empty? lang_lexer.continue_lex($', &output) elsif comment_regex =~ input[0].strip