Remove br tags around images with webhelp output?

<oXygen/> general issues.
tomjohnson1492
Posts: 132

Remove br tags around images with webhelp output?

Fri Jan 09, 2015 12:50 am

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

Re: Remove br tags around images with webhelp output?

Sat Jan 10, 2015 8:53 pm

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

Re: Remove br tags around images with webhelp output?

Sat Jan 10, 2015 9:02 pm

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

Code: Select all

p.p + br, br + br {display:none;}
sorin_ristache
Posts: 4144

Re: Remove br tags around images with webhelp output?

Tue Jan 13, 2015 12:32 pm

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: 9

Re: Remove br tags around images with webhelp output?

Wed Jun 08, 2016 2:31 am

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: 195

Re: Remove br tags around images with webhelp output?

Wed Jun 08, 2016 3:18 pm

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: 9

Re: Remove br tags around images with webhelp output?

Wed Jun 08, 2016 8:48 pm

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

Return to “Other Issues”

Who is online

Users browsing this forum: No registered users and 1 guest