Skip to content

Commit

Permalink
Use Text::Whitespace token in Console lexer (#894)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
alexanderweiss authored and pyrmont committed Aug 5, 2019
1 parent d4e52dd commit 96efe28
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rouge/lexers/console.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 96efe28

Please sign in to comment.