From dbea982d7f3f1eec36436822f3d27945128a464b Mon Sep 17 00:00:00 2001 From: Dan Allen Date: Wed, 15 Feb 2017 01:18:33 -0700 Subject: [PATCH] rename pygments_config Hash to lexer_opts --- lib/asciidoctor-pdf/converter.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/asciidoctor-pdf/converter.rb b/lib/asciidoctor-pdf/converter.rb index dc3942ede..88617a004 100644 --- a/lib/asciidoctor-pdf/converter.rb +++ b/lib/asciidoctor-pdf/converter.rb @@ -1202,11 +1202,11 @@ def convert_listing_or_literal node when 'pygments' Helpers.require_library 'pygments', 'pygments.rb' unless defined? ::Pygments lexer = ::Pygments::Lexer.find_by_alias(node.attr 'language', 'text', false) || ::Pygments::Lexer['text'] - pygments_config = { + lexer_opts = { nowrap: true, noclasses: true, stripnl: false, - style: style = (node.document.attr 'pygments-style') || 'pastie' + style: (style = (node.document.attr 'pygments-style') || 'pastie') } # TODO enable once we support background color on spans #if node.attr? 'highlight', nil, false @@ -1227,7 +1227,7 @@ def convert_listing_or_literal node source_string, conum_mapping = extract_conums source_string # NOTE pygments.rb strips trailing whitespace; preserve it in case there are conums on last line num_trailing_spaces = source_string.size - (source_string = source_string.rstrip).size if conum_mapping - result = lexer.highlight source_string, options: pygments_config + result = lexer.highlight source_string, options: lexer_opts fragments = guard_indentation text_formatter.format result conum_mapping ? (restore_conums fragments, conum_mapping, num_trailing_spaces) : fragments when 'rouge'