We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37327
    • 8 Posts

    Screenshot Attached
      • 37327
      • 8 Posts
      Hi all,

      I've been experiencing this weird issue with Modx on a particular site i am working on where the output of HTML pushed to the client under certain situations contains 'extra' breaklines (not
      ) which push certain parts of the content down breaking the visual style of the front-end.

      The site is using the YAMS multilingual plugin for Modx evo.

      I have identified that this only happens in a very specific circumstance which is the following:

      When a snippet calls another snippet (nested snippets) an extra 'invisible' breakline is added along with the output which causes the content below it to be pushed down as if there was an empty paragraph in place.

      Weirdly enough this only happens when the site is pushing Portuguese content (the issue does not occur under English, Spanish or Greek).

      When viewing the HTML source in the browser the extra line is not visible in any way, only by using the browser dev toolkit can you see that there is this extra phantom line. (attached is a screen shot).

      I have already tried striping all occurrences of "\r","\n","\t" from the output via a plugin, which although leaves the site with a nice minified html source does not solve the issue.

      Any ideas of why this might be happening and how i can get rid of it?
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        \r, \n, \t don't show up on the browser in any case. The only thing that can make spaces or lines in a browser are br tags or styling for elements adding padding or margins. Without seeing the HTML source of the page in question, it's impossible to guess what might be causing the extra spacing.
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 37327
          • 8 Posts
          Quote from: sottwell at Jul 10, 2013, 04:47 AM
          \r, \n, \t don't show up on the browser in any case. The only thing that can make spaces or lines in a browser are br tags or styling for elements adding padding or margins. Without seeing the HTML source of the page in question, it's impossible to guess what might be causing the extra spacing.

          The thing is that nothing shows in the HTML source. The only way to see that there is the extra gap is by using the 'inspect element' function in chrome. Can be seen in the screenshot attached in the thread.
            • 37327
            • 8 Posts
            Quote from: andrewborg at Jul 10, 2013, 05:24 AM
            Quote from: sottwell at Jul 10, 2013, 04:47 AM
            \r, \n, \t don't show up on the browser in any case. The only thing that can make spaces or lines in a browser are br tags or styling for elements adding padding or margins. Without seeing the HTML source of the page in question, it's impossible to guess what might be causing the extra spacing.

            The thing is that nothing shows in the HTML source. The only way to see that there is the extra gap is by using the 'inspect element' function in chrome. Can be seen in the screenshot attached in the thread.

            In Case it helps someone i have found the issue.

            There is a php include file which contains translated content phrases which was copied from word into the php file in dreamweaver, saved and uploaded to the server.

            The copying from word must have added some end of file garbage somehow to the php file (although nothing was visible in the php file itself).

            Solution: Copy the contents of the php file, delte the file, create a new one, paste the contents smiley