Remove br tags around images with webhelp output?

Oxygen general issues.
tomjohnson1492
Posts: 132
Joined: Thu Apr 17, 2014 1:55 am

Remove br tags around images with webhelp output?

Post by tomjohnson1492 »

When you include an image in a webhelp file, the output puts two br tags before and after the image, like this: http://www.screencast.com/t/dxR4IbnKTB

As a result, I have a lot of excess white space around the image. Why is the webhelp plugin adding all of these br tags in there? This is poor practice as I have little control to add CSS styling there.
tomjohnson1492
Posts: 132
Joined: Thu Apr 17, 2014 1:55 am

Re: Remove br tags around images with webhelp output?

Post by tomjohnson1492 »

I'm wondering if there's a fix for this. It looks pretty bad in my output and I'm not quite sure how to fix it. I tried adding display:none for my br tags, but it messes with other elements, such as related links.
tomjohnson1492
Posts: 132
Joined: Thu Apr 17, 2014 1:55 am

Re: Remove br tags around images with webhelp output?

Post by tomjohnson1492 »

I added an adjacent sibling select to hide the br tags:

Code: Select all


p.p + br, br + br {display:none;}
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Remove br tags around images with webhelp output?

Post by sorin_ristache »

Please post the XML fragment that adds the image to the DITA topic in order to generate the two <br> elements in the WebHelp page. I tried with Oxygen 16.1 and no <br> element was added in the output, but it may be an additional attribute or element that you have in your DITA XML file that creates this difference between my output and your output.

We plan to add a more general fix in the next Oxygen version for any sequence of two adjacent <br> elements in a WebHelp page, but first reproducing the problem with the <br> elements near an <img> would be helpful for us.
Regards,
Sorin

<oXygen/> XML Editor Support
lopresti
Posts: 13
Joined: Mon Mar 24, 2014 11:22 pm

Re: Remove br tags around images with webhelp output?

Post by lopresti »

I'm seeing similar <br> tags inserted before and after images

[url]https://harmonicinc.box.comImage[/url]


Here is the DITA source for the topic:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept id="concept_y44_sqf_f5">
<title>Cross-references and links</title>
<shortdesc>Links help readers find information and travel from one topic to
another.</shortdesc>
<conbody>
<p>For detailed information on the different link types, refer to chapter 7 in <cite>DITA
Best Practices</cite>.</p>
<section id="section_o3q_2xq_dw">
<title>Hierarchical links</title>
<p>Hierarchical links are automatically generated when a DITA map is output to PDF or
WebHelp. These links appear in the order of their corresponding topic references
in the map. A parent topic is at the top of the hierarchy. It becomes a landing
or navigation topic that has links to the child topics underneath it. </p>
<fig id="fig_zxr_frp_yv">
<title>WebHelp TOC with links based on map hierarchy</title>
<image placement="break" href="../../images/hierarchical_links_webhelp_mini.png"
id="image_zls_nqp_yv" width="200"/>
</fig>
<fig id="fig_bmg_3rp_yv">
<title>Landing page with links based on map hierarchy and collection-type
attribute</title>
<image placement="break" href="../../images/hierarchical_links_numbered.png"
id="image_hfb_krp_yv"/>
</fig>
</section>
bogdan_cercelaru
Posts: 222
Joined: Tue Jul 01, 2014 11:48 am

Re: Remove br tags around images with webhelp output?

Post by bogdan_cercelaru »

Hello,

The <br> tags are inserted due to the placement="break" attribute.
You should remove this attribute and the <br> tags will be removed from the WebHelp output.

Regards,
Bogdan
Bogdan Cercelaru
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
lopresti
Posts: 13
Joined: Mon Mar 24, 2014 11:22 pm

Re: Remove br tags around images with webhelp output?

Post by lopresti »

Thank you! I didn't realize that @placement wasn't necessary when using the <fig> element.
Post Reply