• 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

swatme

Well-known member
#1
Under the CREATE TEMPLATE MODIFICATION
( /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
xforo.jpg
 

Mike

XenForo developer
Staff member
#4
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.
 

Snog

Well-known member
#5
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.
 

Daniel Hood

Well-known member
#6
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.
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.
 

Chris D

XenForo developer
Staff member
#7
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 :)