Fixed Formatting Bug in code: Copy and Paste

swatme

Well-known member
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.webp
 
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.
 
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.
 
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.
 
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 :)
 
Top Bottom