diff --git a/spec/visual/app.rb b/spec/visual/app.rb index 128d198e47..71070c3ca6 100644 --- a/spec/visual/app.rb +++ b/spec/visual/app.rb @@ -40,6 +40,7 @@ def query_string theme_class = Rouge::Theme.find(params[:theme] || 'thankful_eyes') halt 404 unless theme_class @theme = theme_class.new(scope: '.codehilite') + @comment_color = @theme.class.get_style(Rouge::Token::Tokens::Comment).fg formatter_opts = { :line_numbers => params[:line_numbers] } formatter_opts[:inline_theme] = @theme if params[:inline] @@ -53,6 +54,7 @@ def query_string @sample = File.read(SAMPLES.join(@lexer.class.tag), encoding: 'utf-8') @title = "#{@lexer.class.tag} | Visual Test" + @raw = Rouge.highlight(@sample, 'plaintext', @formatter) @highlighted = Rouge.highlight(@sample, @lexer, @formatter) erb :lexer diff --git a/spec/visual/templates/index.erb b/spec/visual/templates/index.erb index 9c20a34ac4..6df2ef4fcf 100644 --- a/spec/visual/templates/index.erb +++ b/spec/visual/templates/index.erb @@ -1,20 +1,32 @@ -
<%
- Rouge::Token.each_token do |token|
- %><%= token.qualname %>
-<% end
- %>
-<%= @raw %>+
<%= CGI.escape_html(@sample) %>+