Description: Fix output of <screen> with <userinput>/<computeroutput>
 <screen> implies a verbatim environment but this was not respected
 if you use sub-elements like <userinput>/<computeroutput>.
 . 
 This patch improves Publican::XmlClean->my_as_XML() to look for
 the verbatim environmement in all ancestors instead of only the direct
 parent.
 .
 Upstream currently considers this to not be a bug. So this patch
 might stay as Debian specific for a while.
Author: Raphaël Hertzog <hertzog@debian.org>
Bug: https://bugzilla.redhat.com/show_bug.cgi?id=752851

--- a/lib/Publican/XmlClean.pm
+++ b/lib/Publican/XmlClean.pm
@@ -865,10 +865,15 @@ sub my_as_XML {
             }
             else {    # it's just text
                 my $parent = $_[3];
+                my $is_verbatim = 0;
+                my $ancestor = $parent;
+                while ($ancestor && !$is_verbatim) {
+                    $is_verbatim = $MAP_OUT{ $ancestor->{'_tag'} }->{'verbatim'};
+                    $ancestor = $ancestor->parent();
+                }
 
                 # Remove extra space from non-verbatim tags
-                if ( $parent
-                    && !( $MAP_OUT{ $parent->{'_tag'} }->{verbatim} ) )
+                if (!$is_verbatim)
                 {
 
                   # Don't out put empty tags
