1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed Formatting Bug in code: Copy and Paste

Discussion in 'Resolved Bug Reports' started by swatme, Jun 11, 2015.

  1. swatme

    swatme Well-Known Member

    ( /admin.php?template-modifications/add )

    when you copy the original code and paste in the search box
    it will not copy the new line character as per the original formatting of the code

    see screenshot
  2. swatme

    swatme Well-Known Member

    looks like this affects the Firefox browser
  3. Martok

    Martok Well-Known Member

    I've just tested this and the new line character copied correctly. I used Chrome for Android.
  4. Mike

    Mike XenForo Developer Staff Member

    I know this was reported before, but I believe it was actually fixed in Firefox (or we did a workaround?). It's fundamentally a Firefox bug, but I'm not sure if there's been a regression here from it.
  5. Snog

    Snog Well-Known Member

    Interesting tidbit about this using Firefox...

    If you copy from the edit template screen and paste into the template modification Find box, it retains the new lines

    If you copy from the Template Contents box on the template modification screen, it does not retain the new lines.
  6. Daniel Hood

    Daniel Hood Well-Known Member

    That's interesting. A possible solution could be switching the template modification template to use a readonly textarea instead of a div if that's the case.
  7. Chris D

    Chris D XenForo Developer Staff Member

    We've fixed this by changing the template code <div> into a <pre>.

    Incidentally, the bug Mike mentions was first reported in Firefox in 2001. It does appear to be fixed as of April 2015 but has since broken again :)
    Xon and Snog like this.

Share This Page