Skip to main content
Inspiring
June 28, 2024
Question

space before slash in self-closing HTML tags

  • June 28, 2024
  • 11 replies
  • 3345 views

This is a dumb question—let me acknowledge that right out of the gate. I hope it's an easy one to answer.

My team is three technical writers, each on a different version of RoboHelp, which you don't have to tell me is a bad idea:

  • 2022.3
  • 2020.x
  • 2020.x+1

My hope is we can all get up to 2022.3 (not .4; there's {probably} a bug that interferes with our Git > Bitbucket workflow) soon, after the dust settles from our current quarterly release madness.

In the meantime, here is a "duck season! wabbit season!" fight going on about spaces in self-closing tags. 2022 puts them in: <br /> and 2020 takes them out: <br/>

Is it definitely due to running different versions of the app, or is there a settings file somewhere that we could tweak? Thank you for your attention to this silly but still mildly annoying issue.

    11 replies

    Peter Grainge
    Community Expert
    Community Expert
    February 12, 2025

    I have added my comment to the bug report with a further small amendment about only the filename change should be made.

    ________________________________________________________

    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
    February 12, 2025

    So a simple way of writing the bug would be this, correct?

    ****************************************

    Create a project with two simple topics.

    In Topic Two create a link to Topic One.

    Save and close Topic Two., then change the filename of Topic One.
    That will force RoboHelp to change in Topic Two the filename in the link to Topic One whilst Topic Two is closed.

    The poster's expectation is that only the filename will be changed. The reality is that RoboHelp is not simply changing the filename, it is also revising other lines of code such as concatenating lines and adding spaces before closing tags.

    There may be other examples of  changes triggering the code in a closed topic being changed.
    The poster's process is for changes to be reviewed at code level by another team member. Instead of just seeing the filename change, they are seeing other lines of code have changed. This is wasting time in the review process.

    The belief is only the change, in this example a filename change, should be made.

    ****************************************

    ________________________________________________________

    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.
    ugarrdaAuthor
    Inspiring
    February 12, 2025

    That's worlds better than my clumsy attempts. I would only correct one point: "…such as concatenating lines and removing spaces from self-closing tags." Everything else is spot on. Thank you!

    Inspiring
    February 26, 2025

    Hi,
    I just wanted to let you know that you're not the only one facing this issue and finding it frustrating. We use RH 2022.5 and Git for source control.
    For the record, in case anyone else encounters this issue, here's what we've discovered:
    All self-closing tags in a topic are affected: img, br, meta, link, etc. Additionally, the last two closing tags of the topic, </body> and </html>, are also affected.

    What triggers it:
    Any change you make to a topic without opening it in the editor can cause this issue. For example:
    - create a conditional tag
    - apply it to any sentence in your topic, then close and save the topic
    - delete the conditional tag from the conditional tags menu
    - check the topic changes with your source control

    What it does:
    It removes the spaces as described by you and places the last two tags, </body> and </html>, next to each other on one line.

    This causes our source control (as you already mentioned) to identify numerous changes in the topic, not just the removal of the conditional tag. If you open the topic in RH, the spaces are automatically reinserted by RH.

    For us, this is really frustrating because opening all topics in RH just to reinsert the spaces is not an option ....

    Peter Grainge
    Community Expert
    Community Expert
    February 12, 2025

    I have looked at your bug report at https://tracker.adobe.com/#/view/RH-12835 and having looked again at this thread in the cold light of day, I think I would describe the problem in a different way. If I am following correctly, there are two issues here and I don't think they are related.

     

    @ugarrda See what you think. If you agree, I will add the following as a comment to your bug report.

     

    ****************************************

     

    If I am following correctly, there are two issues here and I am now wondering if they are related. Please check and come back. If they are not I think the bug report needs to be revised in a comment.

    ISSUE ONE
    If you open a topic with a <br /> tag (note the space) in a text editor, the space is not there, it is written as <br>. There was a similar issue in Classic perhaps fifteen years or more back. There what the RoboHelp code showed was not the same as what a text editor showed. That caused problems but I cannot remember the details of why.

    This problem can be created simply by opening a topic with a <br /> tag (note the space) in a text editor,, the space will not be shown.

    RoboHelp should show the same code when view in a text editor.

    ISSUE TWO
    In Topic Two create a link to Topic One and save. Then change the filename of Topic One.
    In Topic Two that will force RoboHelp to change the filename in the link to Topic One.
    The issue is that RoboHelp is not simply changing the filename, it is also revising other lines of code.
    The poster's process is for changes to be reviewed at code level by another team member. Instead of just seeing the tag change, they are seeing other lines of code that have changed. This is wasting time in the review process.

    ________________________________________________________

    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.
    Jeff_Coatsworth
    Community Expert
    Community Expert
    February 12, 2025

    I'm not sure Issue #1 is actually happening. @ugarrda can confirm.

    Peter Grainge
    Community Expert
    Community Expert
    February 12, 2025

    I can see Issue One. 

    ________________________________________________________

    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
    February 11, 2025

    Well I was going to ask but I prepared a text file showing a break tag with no space. Then I spotted the Explorer preview. Note the space. It comes back to different editors/viewers will show the tag the way they have been programmed.

     

    ________________________________________________________

    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
    February 11, 2025

    I think the key point is that according to the link I posted, the correct tag is <br />, with the space. Adobe have set their editor to apply the current standard for the document type. If you open the topic in any other editor, it will depend on how they present the code. Nobody is adding or removing the space, it is down to how any editor writes the code. Your one is not apply the current standard for the document type.

    ________________________________________________________

    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
    February 10, 2025

    Adobe have confirmed this is not a bug and is a change in the update. It seems <br /> is the correct way to write the tag for this document type. 

    <br>: The Line Break element - HTML: HyperText Markup Language | MDN

     

    Scroll down to Tag Omission.

    ________________________________________________________

    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
    February 8, 2025

    In 2022.5 I am seeing the tag created as <br />.

    • Close and reopen the tag it stays the same.
    • Remove the space, close and reopen the tag, the space gets put back in.
    • In a topic with <br /> and a link to another topic I changed the filename of the target topic but the space did not get removed.

     

    If I got the last step wrong, let me know. 

     

    As your subscriptions entitle you to all use 2022.5 and you asked if the issue is related to different versions, I would say it is. You know what to do. 🙂

     

    Happy to run another test if it will help you.

    ________________________________________________________

    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.
    ugarrdaAuthor
    Inspiring
    February 10, 2025

    In your last step, may I ask how you verified that the space did not get removed? If you opened it in the RoboHelp editor, RoboHelp would have replaced the space. I'll see if I can make a video. If it makes a difference, I'm using the macOS version, 2022.5.24.

    ugarrdaAuthor
    Inspiring
    February 10, 2025

    OK, this is a quick and dirty video. https://app.screencast.com/IBHSCiLUyS1d2

    Please let me know whether or not you can replicate this behavior. Thanks so much for your help!

    Peter Grainge
    Community Expert
    Community Expert
    February 7, 2025

    A linter is a tool to check code. Please explain the steps to see this issue.

    ________________________________________________________

    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.
    ugarrdaAuthor
    Inspiring
    February 7, 2025

    I'll do my best!

    1. Create two topics: filename1 and filename2.
    2. In filename2, add at least one self-closing tag, such as <br /> and make sure you put a space between the br and the /.
    3. In filename2, add a link to filename1.
    4. Save, commit, push to version control (we are using Bitbucket but I don't know if that's relevant).
    5. Make sure filename2 is not open in the editor.
    6. Change filename1 to filename3. We expect this will automatically update the link in filename2.
    7. Commit your change. What I see is that even though I have not directly edited the content of filename2, the space between br and / has been automatically removed by RoboHelp. We see other weird behavior too, for instance the <html> and <head> tags were originally on two lines but are automatically changed to be on the same line.
    Peter Grainge
    Community Expert
    Community Expert
    February 7, 2025

    Why would anyone want to add a space rather than let RoboHelp create code in the way Adobe have programmed it?

     

    Also what impact is this having on the output?

     

    It seems as if you just don't like the code rather than it being a problem.

     

    I'll look more in the morning.

    ________________________________________________________

    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
    February 7, 2025

    Does this only happen when you run your code through a linter? In other words RoboHelp doesn't add this space. If so, isn't this a question for the linter tool.

    ________________________________________________________

    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.
    ugarrdaAuthor
    Inspiring
    February 7, 2025

    We are not using a separate linter. This is just the behavior we have observed in RoboHelp.

    ugarrdaAuthor
    Inspiring
    February 7, 2025

    We are all now on RH 2022.5 and still having the issue. It feels even more like a bug now.

     

    If we edit a topic, the linter insists upon <br /> with a space before the slash. If we change a file name, all the other pages that refer to that file get the link updated automatically, and the linter changes all the self-closing tags on the referring pages to <br/> with no space before the slash. It is super annoying to have to review multiple lines in the pull request diff, when only one line really changed.

     

    The workaround seems to be to open each referring topic in the editor before committing. The linter puts the spaces back before the slashes, essentially undoing the automatic changes and leaving only the changed filename/link.

    Jeff_Coatsworth
    Community Expert
    Community Expert
    February 7, 2025

    I've never heard of anyone using a linter with RH - what one is it & how do you have it hooked up?

    ugarrdaAuthor
    Inspiring
    February 7, 2025

    See my reply to Peter below. We don't have a linter, that's just the word I used to describe what RoboHelp is doing on its own. Another example would be if I edit a topic in the Source view and screw up the indent level, RoboHelp will fix the indent level by itself as soon as I go back to Author view.