Steps to reproduce:
1.Open a page with VE which has for example the following gallery code:
File:Joo Chiat Place.jpg|Item 1
File:Joo Chiat Place.jpg|a link to [[Help:Contents]]
File:Joo Chiat Place.jpg
File:Joo Chiat Place.jpg|alt=An example image. It has flowers
File:Joo Chiat Place.jpg| ''italic caption''
2.Click on the gallery and open it with the new gallery inspector
There is an extra newline inserted at the beginning of gallery code inside the inspector.
See the screenshot attached.
Test Environment: https://test2.wikipedia.org/
Browser: Chrome Version 26.0.1410.65 & FF 25
OS: MAC OS X 10. 8. 5