Extra space added for <codeblock> and <codeph>

Posts: 11
Joined: Mon Jul 10, 2017 2:18 am

Extra space added for <codeblock> and <codeph>

Post by shanweizhong » Thu May 16, 2019 5:47 am

Hi everyone,

I'm using "DITA Map PDF - based on HTML5 & CSS" in XML Author 21 to generate PDF documents, and I found sometimes an extra space is inserted for the <codeblock> and <codeph> tags.
  • For the following code, and extra space is inserted at the beginning of the code block:

    Code: Select all

    by removing the following two lines:
    <codeblock>&lt;extension module="org.jboss.as.jaxrs"/>
    &lt;subsystem xmlns="urn:jboss:domain:jaxrs:1.0"/></codeblock>
  • For the <codeph> tag, if a punctuation mark such as a comma or period is added right after it, an extra space is inserted before the punctuation mark. Like in the following code:

    Code: Select all

    ...are also controlled in <codeph>customer.xml</codeph>. 
I'm not sure how to solve the problem. Can anyone give me a hand?


Posts: 385
Joined: Mon Feb 03, 2003 10:56 am

Re: Extra space added for <codeblock> and <codeph>

Post by Dan » Thu May 16, 2019 10:16 am

Hello Michael,

The transformation add a code inside the pre element. This is an inline element, that has some padding set from the built-in CSS. You should remove its padding:

Code: Select all

	padding:2px 4px;
pre > code{
I fixed this in the default CSSs.

If you encounter more problems, please consider debugging the CSS as explained here:
https://www.oxygenxml.com/doc/versions/ ... e_css.html

Thank you for the feedback,

Post Reply