Bug 461369 - Publican incorrectly formats programlisting and screen sections
Summary: Publican incorrectly formats programlisting and screen sections
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Publican
Classification: Community
Component: publican
Version: 1.6
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jeff Fearn 🐞
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-09-06 20:15 UTC by Jared Smith
Modified: 2010-11-24 04:19 UTC (History)
3 users (show)

Fixed In Version: 0.38
Clone Of:
Environment:
Last Closed: 2008-09-09 03:42:36 UTC
Embargoed:


Attachments (Terms of Use)
The generated HTML page (5.09 KB, text/html)
2008-09-06 20:15 UTC, Jared Smith
no flags Details
The generated PDF file (61.44 KB, application/pdf)
2008-09-06 20:19 UTC, Jared Smith
no flags Details

Description Jared Smith 2008-09-06 20:15:57 UTC
Created attachment 315955 [details]
The generated HTML page

Description of problem:

Publican incorrectly formats <programlisting> and <screen> sections in DocBook.  As explained in both http://docbook.org/tdg/en/html/programlisting.html and http://docbook.org/tdg/en/html/screen.html, all whitespace and line breaks in those sections are significant and must be preserved.  The current version of publican does not preserve line-breaks correctly in either of these tags.

Version-Release number of selected component (if applicable):

publican-0.34-0.fc9.noarch

How reproducible:

Always

Steps to Reproduce:
1.  Add the following section to a default Publican document (I did it in an article):

<programlisting format="linespecific"><computeroutput>[root@localhost ~]# </computeroutput><userinput>mkdir /tmp/one</userinput>
<computeroutput>[root@localhost ~]# </computeroutput><userinput>mkdir /tmp/two</userinput>
<computeroutput>[root@localhost ~]# </computeroutput><userinput>mkdir /tmp/three</userinput></programlisting>

2. Create both PDF and HTML versions of the document
3. Notice how the line breaks are not correct.  The PDF doesn't add line breaks where they belong, and the HTML adds extra line breaks and extra indents.
  
Actual results:

See the attached files... I'm attaching both a PDF and HTML version.

Expected results:

Three individual lines, that look like:

[root@localhost ~]# mkdir /tmp/one
[root@localhost ~]# mkdir /tmp/two
[root@localhost ~]# mkdir /tmp/three

Additional info:

I tried out the "Fedora" branding in publican as well, and it suffered from the same formatting problems.

Comment 1 Jared Smith 2008-09-06 20:19:06 UTC
Created attachment 315956 [details]
The generated PDF file

Comment 2 Jared Smith 2008-09-07 11:34:25 UTC
Murray McAllister kindly pointed out that this bug is probably related to bug #461221.

Comment 3 Jeff Fearn 🐞 2008-09-09 03:42:36 UTC
Non-verbatim tags are fully entitled to munch you white space, even when nested inside verbatim tags.

Comment 4 Jeff Fearn 🐞 2008-09-19 07:17:45 UTC
This was a bug!

The new line was being removed from the verbatim tag itself and not from an inline tag within the verbatim tag.

e.g. 1

This will, correctly, have it's new line removed because computeroutput is an inline tag and inline tags never, ever, EVER respect white space:

<screen><computeroutput>
Preparing...                ######################################### [100%]   
   1:foo                    ######################################### [100%]</computeroutput></screen>

e.g. 2

This would have it's new line removed because the userinput tag swallowed up the following new line:

<programlisting>
[root@localhost ~]# <userinput>mkdir /tmp/one</userinput>
[root@localhost ~]# <userinput>mkdir /tmp/two</userinput>
</programlisting>

This second is a bug because the new line is in the verbatim screen tag and not inside the inline userinput tag.

Changed white space munching code to respect new lines directly in verbatim tags regardless of what precedes them.

Comment 5 Jared Smith 2008-09-20 05:18:35 UTC
Thanks for revisiting this one, Jeff!

Comment 6 Fedora Update System 2008-10-16 22:43:33 UTC
publican-0.38-0.fc9,perl-XML-TreeBuilder-3.09-11.fc9 has been submitted as an update for Fedora 9.
http://admin.fedoraproject.org/updates/publican-0.38-0.fc9,perl-XML-TreeBuilder-3.09-11.fc9

Comment 7 Fedora Update System 2008-11-07 02:54:49 UTC
publican-0.38-0.fc9, perl-XML-TreeBuilder-3.09-11.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.