Sha256: 5831971b48fe73433f539a2bc32ec4f38166c0ea1cfd726ff529128043ae0b10

Contents?: true

Size: 376 Bytes

Versions: 5

Compression:

Stored size: 376 Bytes

Contents

module Rouge
class CSSTheme
  # Patch style_for to return most specific style first
  # See https://github.com/jneen/rouge/issues/280
  # Fixed as of rouge v1.10.0
  def style_for token
    token.token_chain.reverse_each do |t|
      if (s = styles[t])
        return s
      end
    end
    nil
  end
end
end if (Gem::Version.new Rouge.version) < (Gem::Version.new '1.10.0')

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
asciidoctor-pdf-1.5.0.alpha.16 lib/asciidoctor-pdf/rouge_ext/css_theme.rb
asciidoctor-pdf-1.5.0.alpha.15 lib/asciidoctor-pdf/rouge_ext/css_theme.rb
asciidoctor-pdf-1.5.0.alpha.14 lib/asciidoctor-pdf/rouge_ext/css_theme.rb
asciidoctor-pdf-1.5.0.alpha.13 lib/asciidoctor-pdf/rouge_ext/css_theme.rb
asciidoctor-pdf-1.5.0.alpha.12 lib/asciidoctor-pdf/rouge_ext/css_theme.rb