This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 461677 - Vex generates line break in the middle of DocBook verbatim environments
Summary: Vex generates line break in the middle of DocBook verbatim environments
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 1.2.0 M2   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-09 02:24 EDT by Chuanhua Chang CLA
Modified: 2015-07-04 07:43 EDT (History)
2 users (show)

See Also:


Attachments
an example xml file showing that VEX adds a line break in the middle of <programlisting> tags. (372 bytes, text/xml)
2015-03-09 02:24 EDT, Chuanhua Chang CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chuanhua Chang CLA 2015-03-09 02:24:18 EDT
Created attachment 251389 [details]
an example xml file showing that VEX adds a line break in the middle of <programlisting> tags.

I created a DocBook xml file with Vex. In the xml file, I had a line of text wrapped in <literallayout> or <programlisting> tags. The line of text is not too long, compared with the "line width" setup in the Vex preference page. After processing the file through xsltproc to produce a HTML file, I found that the line of text is broken into two lines.

Then I realized that in order to reformat the xml file, Vex added line breaks in the middle of my line of text surrounded by the docbook verbatim tags.

I have attached a xml file with this problem. The Vex line width is set to 80.

I think if a line with such a verbatim tag is longer than the line width, Vex should add line breaks before the verbatim tags, not in the middle of it.
Comment 1 Eclipse Genie CLA 2015-05-05 16:03:02 EDT
New Gerrit change created: https://git.eclipse.org/r/47213
Comment 2 Carsten Hiesserich CLA 2015-05-05 16:07:24 EDT
In the docbook CSS definition, the formalpara > para element is erroneously defined as inline. Verbatim content in an inline element is not possible, so the pre CSS for programlisting is ignored when the document is written.
Commit 459fad079da3de4b70c72cd9419df9bba5605611 removes the illegal inline definition.
In my opinion, Vex should not destroy a document when a simple CSS definition is wrong, so we should not rely on a 'inline' definition in DocumentWriter.
Comment 4 Florian Thienel CLA 2015-05-10 04:54:24 EDT
(In reply to Carsten Hiesserich from comment #2)
> In my opinion, Vex should not destroy a document when a simple CSS
> definition is wrong, so we should not rely on a 'inline' definition in
> DocumentWriter.

Yes, that's right, there should be no connection between the CSS (i.e. visual representation) and the represenation of the content in the file. The reason why it is done is to have some reasonable pretty printing in the file.

A better alternative would be to infer the "inline" property of an element by just looking if there is some text in the element's parent around. This would lead to a more consistent way of pretty printing, because it stays stable even if the CSS is switched.
Comment 5 Florian Thienel CLA 2015-07-04 07:43:00 EDT
fixed, will come in the next milestone