Skip to main content
Inspiring
August 14, 2023
Answered

How to prevent RH 2022 from adding line breaks (<br />

  • August 14, 2023
  • 5 replies
  • 429 views

I have been using RH 2022 for quite a while now and I am finding that it often adds <br /> to my html. I don't want it to do that. Just about every day I have to go into the html view and delete a <br /> that RH added without my permission. For example, I never press shift-enter. I am not sure what I am doing that causes this. Does anyone know how to avoid this? Does anyone else have this problem?

I am using RH 2022.2.22. 

 

Thanks,

Jim

    This topic has been closed for replies.
    Correct answer JamesJim

    OK I discovered one scenario where it adds the extra <br />. If I press the ENTER key twice in a row, it will add a <br />.  I realize having two paragraphs in a row is bad form, but I do it because I am in the middle of editing and I want to keep one section separated from another until I am finished editing. Or maybe I want to add something like an image or a table and I don't know exactly where I want to put it. I will eventually remove the extra <p>'s but in the short term I want them there. The problem is that it is hard to get rid of once it is there and it isn't even obvious that it is there (RH does not show a symbol like it does for a paragraph). We are trying to be consistant in our styles and so if we want extra space between lines, we change our style in the CSS. So our policy is to avoid <br>'s whenever possible. We now have a lot of places in our documentation where the extra <br> is making a larger gap between lines or images and the author did not realize it was there. So I have to go searching for these and remove them manually.

     

    I think RH is thinking about browser compatibility and some browsers may ignore double <p>'s. So RH is thinking that the author wanted an extra blank line, and since some browsers will ignore double <p>'s, it puts in a <br /> because that is what it thinks the author wanted. I just wish RH wouldn't try to outsmart me and do what I told it to do. 

     

    I doubt I can convince Adobe to not do this, so I think I will just have to try to figure out what conditions make this happen (I already discovered one) and try to avoid them. 

    5 replies

    JamesJimAuthorCorrect answer
    Inspiring
    August 15, 2023

    OK I discovered one scenario where it adds the extra <br />. If I press the ENTER key twice in a row, it will add a <br />.  I realize having two paragraphs in a row is bad form, but I do it because I am in the middle of editing and I want to keep one section separated from another until I am finished editing. Or maybe I want to add something like an image or a table and I don't know exactly where I want to put it. I will eventually remove the extra <p>'s but in the short term I want them there. The problem is that it is hard to get rid of once it is there and it isn't even obvious that it is there (RH does not show a symbol like it does for a paragraph). We are trying to be consistant in our styles and so if we want extra space between lines, we change our style in the CSS. So our policy is to avoid <br>'s whenever possible. We now have a lot of places in our documentation where the extra <br> is making a larger gap between lines or images and the author did not realize it was there. So I have to go searching for these and remove them manually.

     

    I think RH is thinking about browser compatibility and some browsers may ignore double <p>'s. So RH is thinking that the author wanted an extra blank line, and since some browsers will ignore double <p>'s, it puts in a <br /> because that is what it thinks the author wanted. I just wish RH wouldn't try to outsmart me and do what I told it to do. 

     

    I doubt I can convince Adobe to not do this, so I think I will just have to try to figure out what conditions make this happen (I already discovered one) and try to avoid them. 

    Peter Grainge
    Community Expert
    Community Expert
    August 15, 2023

    Another thought in addition to what @Amebr suggested is browser compliance. The code is now strictly HTML5 and CSS3 compliant and it could be how Adobe ensures that as far as possible, the output looks the same in all browers. Just hazarding a guess.

    ________________________________________________________

    My site www.grainge.org includes many free Authoring and RoboHelp resources that may be of help.

     

    Use menu (bottom right) to mark as Best Answer or to Highlight particularly useful replies. Found the answer elsewhere? Share it here.
    Peter Grainge
    Community Expert
    Community Expert
    August 15, 2023

    Is it changing the display in a way that you don't want? Where does it occur, specific scenarios?

     

    I have seen it in the code but the content has always been what I want.

    ________________________________________________________

    My site www.grainge.org includes many free Authoring and RoboHelp resources that may be of help.

     

    Use menu (bottom right) to mark as Best Answer or to Highlight particularly useful replies. Found the answer elsewhere? Share it here.
    Community Expert
    August 15, 2023

    In that case I don't think there's anything we can do to prevent it.

     

    You can contact support to see if they have any suggestions. See the following page for support contact options. The email address is recommended as it goes to a dedicated Robohelp team.
    https://helpx.adobe.com/contact/enterprise-support.other.html#robohelp

     

     

    Community Expert
    August 14, 2023

    Does the <br> appear in the output? It might be a temporary source file thing to allow topics to display a bit better in the editor.

    JamesJimAuthor
    Inspiring
    August 15, 2023

    Yes the <br> is also in the output.