v25.1 change in behavior for <image placement="break">
Posted: Tue May 23, 2023 5:35 pm
This is a heads-up to my fellow WebHelp users. Given a DITA <image> element with @placement="break":
In v25.0, the webhelp-responsive transformation produces HTML that uses a @class="break" property to apply "display: block" via CSS:
In v25.1, the webhelp-responsive transformation produces HTML that uses <br> elements to make the images effectively block elements:
The v25.1 webhelp-responsive behavior matches the DITA-OT's html5 transformation behavior, which has always used <br> elements to bound placement="break" images (including in Oxygen v25.0).
However, the default CSS properties for <br> elements cause additional vertical space to be added above the image. I'm still deciding how I want to fix this in our flow:
Here's a small testcase for experimentation:
Code: Select all
<p>LINE</p>
<image href="image.png" placement="break"/>
<p>LINE</p>
Code: Select all
<p class="- topic/p p">LINE</p>
<img class="- topic/image image break" src="image.png"/>
<p class="- topic/p p">LINE</p>
Code: Select all
<p class="- topic/p p">LINE</p>
<br><img class="- topic/image image" src="image.png"/><br>
<p class="- topic/p p">LINE</p>
However, the default CSS properties for <br> elements cause additional vertical space to be added above the image. I'm still deciding how I want to fix this in our flow:
- Keep the <br> elements, but add a line-height: 0 property in our CSS file
- In our HTML5 DITA-OT plugin, remove the <br> elements and reapply @class="break" to these image elements
- In our HTML5 DITA-OT plugin, remove the <br> elements and add @styles="display: block" to these image elements
Here's a small testcase for experimentation: