File tree Expand file tree Collapse file tree 4 files changed +36
-8
lines changed
Expand file tree Collapse file tree 4 files changed +36
-8
lines changed Original file line number Diff line number Diff line change 22coverage
33rdoc
44pkg
5- .sass-cache
6- .sassc
75.tmp
86Gemfile.lock
97docs
10- .rbenv- *
118. * .swp
129build
1310doc
1411.yardoc
1512tmp
1613Makefile
17- .mm-pid- *
14+ .bundle
15+ vendor /bundle
Original file line number Diff line number Diff line change 1+ Feature : Lexer options configuration
2+
3+ Scenario : Lexer options are passed to Rouge lexer
4+ Given a fixture app "test-app"
5+ And a file named "config.rb" with:
6+ """
7+ activate :syntax, :lexer_options => { :prompt => 'myshell>>>' }
8+ """
9+ And a file named "source/console_code.html.erb" with:
10+ """
11+ <% code("console") do %>
12+ myshell>>> echo "hello world"
13+ myshell>>> echo "test"
14+ <% end %>
15+ """
16+ And the Server is running
17+ When I go to "/console_code.html"
18+ Then I should see '<span class="gp">myshell>>></span>'
19+ And I should not see '<span class="o">>></span>'
Original file line number Diff line number Diff line change 22Then ( /^I should not see line numbers markup$/ ) do
33 expect ( page ) . not_to have_selector ( "pre.lineno" )
44end
5+
6+ # step definition for testing that specific content is not present
7+ Then ( /^I should not see "([^"]*)"$/ ) do |content |
8+ expect ( page . body ) . not_to include ( content )
9+ end
10+
11+ # step definition for testing that specific content is not present (new format)
12+ Then ( 'I should not see {string}' ) do |content |
13+ expect ( page . body ) . not_to include ( content )
14+ end
Original file line number Diff line number Diff line change @@ -7,14 +7,15 @@ module Highlighter
77
88 # A helper module for highlighting code
99 def self . highlight ( code , language = nil , opts = { } )
10- lexer = Rouge ::Lexer . find_fancy ( language , code ) || Rouge ::Lexers ::PlainText
11-
1210 highlighter_options = options . to_h . merge ( opts )
13- highlighter_options [ :css_class ] = [ highlighter_options [ :css_class ] , lexer . tag ] . join ( ' ' )
1411 lexer_options = highlighter_options . delete ( :lexer_options )
12+
13+ lexer = Rouge ::Lexer . find_fancy ( language , code , lexer_options ) || Rouge ::Lexers ::PlainText
14+
15+ highlighter_options [ :css_class ] = [ highlighter_options [ :css_class ] , lexer . tag ] . join ( ' ' )
1516
1617 formatter = Middleman ::Syntax ::Formatters ::HTML . new ( highlighter_options )
17- formatter . format ( lexer . lex ( code , lexer_options ) )
18+ formatter . format ( lexer . lex ( code ) )
1819 end
1920 end
2021 end
You can’t perform that action at this time.
0 commit comments