summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/asciidoctor/parser.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/asciidoctor/parser.rb b/lib/asciidoctor/parser.rb
index 18f29656..0daba0d7 100644
--- a/lib/asciidoctor/parser.rb
+++ b/lib/asciidoctor/parser.rb
@@ -562,6 +562,7 @@ class Parser
# process lines verbatim
if style && Compliance.strict_verbatim_paragraphs && (VERBATIM_STYLES.include? style)
block_context = style.to_sym
+ cloaked_context = :paragraph
reader.unshift_line this_line
# advance to block parsing =>
break
@@ -820,15 +821,16 @@ class Parser
case block_context
when :listing, :source
if block_context == :source || (language = attributes[1] ? nil : attributes[2] || doc_attrs['source-language'])
- if language
+ if language # :listing
attributes['style'] = 'source'
attributes['language'] = language
AttributeList.rekey attributes, [nil, nil, 'linenums']
- else
+ else # :source
AttributeList.rekey attributes, [nil, 'language', 'linenums']
if doc_attrs.key? 'source-language'
attributes['language'] = doc_attrs['source-language']
end unless attributes.key? 'language'
+ attributes['cloaked-context'] = cloaked_context unless cloaked_context == :listing
end
if (attributes.key? 'linenums') || (doc_attrs.key? 'source-linenums-option')
attributes['linenums-option'] = ''
@@ -857,6 +859,7 @@ class Parser
else
attributes['language'] = language
end
+ attributes['cloaked-context'] = cloaked_context
if (attributes.key? 'linenums') || (doc_attrs.key? 'source-linenums-option')
attributes['linenums-option'] = ''
end unless attributes.key? 'linenums-option'