summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2014-07-16 02:59:09 -0600
committerDan Allen <dan.j.allen@gmail.com>2014-07-16 02:59:09 -0600
commit361225d4b3b300bfea4c1e430a09d8176fccd586 (patch)
tree077d3b2acd26c9ad226574e16f965806e2fddd3b
parent47345638ecd75438b2027a4637ddf28d4e4eae5d (diff)
resolves #931 wrap <para> around admonition inside example block in DocBook 4.5
-rw-r--r--lib/asciidoctor/converter/docbook45.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/asciidoctor/converter/docbook45.rb b/lib/asciidoctor/converter/docbook45.rb
index 412d3b27..65b8e996 100644
--- a/lib/asciidoctor/converter/docbook45.rb
+++ b/lib/asciidoctor/converter/docbook45.rb
@@ -4,6 +4,17 @@ module Asciidoctor
# A built-in {Converter} implementation that generates DocBook 4.5 output
# consistent with the docbook45 backend from AsciiDoc Python.
class Converter::DocBook45Converter < Converter::DocBook5Converter
+ def admonition node
+ # address a bug in the DocBook 4.5 DTD
+ if node.parent.context == :example
+ %(<para>
+#{super}
+</para>)
+ else
+ super
+ end
+ end
+
def olist node
result = []
num_attribute = node.style ? %( numeration="#{node.style}") : nil