Skip to content

Commit

Permalink
avoid leaky language variable when processing source block
Browse files Browse the repository at this point in the history
  • Loading branch information
mojavelinux committed Mar 8, 2024
1 parent d3b48e2 commit b095a23
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/asciidoctor/parser.rb
Expand Up @@ -819,7 +819,7 @@ def self.next_block reader, parent, attributes = {}, options = {}
unless block
case block_context
when :listing, :source
if block_context == :source || (!attributes[1] && (language = attributes[2] || doc_attrs['source-language']))
if block_context == :source || (language = attributes[1] ? nil : language = attributes[2] || doc_attrs['source-language'])
if language
attributes['style'] = 'source'
attributes['language'] = language
Expand Down

0 comments on commit b095a23

Please sign in to comment.