# Javascript errors when copying and pasting from external text editor

**URL:** <https://discourse.codecombat.com/t/javascript-errors-when-copying-and-pasting-from-external-text-editor/151>\
**Category:** Solved\
**Created:** [January 5, 2014, 12:25am UTC](https://discourse.codecombat.com/t/javascript-errors-when-copying-and-pasting-from-external-text-editor/151 "2014-01-05T00:25:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tpsjr7](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/tpsjr7/32/8765_2.png) [@tpsjr7](https://discourse.codecombat.com/u/tpsjr7)\
**Post date:** [January 5, 2014, 12:25am UTC](https://discourse.codecombat.com/t/javascript-errors-when-copying-and-pasting-from-external-text-editor/151/1 "2014-01-05T00:25:32Z")

</div>

I’m trying to code a solution to the gridmancer level.

I’m running into trouble when I try to backup my code. I copy and paste from the CodeCombat editor into Notepad++.

Then when I copy my code from Notepad++ back into the CodeCombat editor I see in Chrome, Windows 7 64 bit javascript console these errors:  
randotron\_0.7834251932799816:7:40: Unterminated String Literal vendor.js:3279  
randotron\_0.7834251932799816:8:1: Invalid unicode escape sequence in identifier vendor.js:3279  
randotron\_0.7834251932799816:8:1: Character code ‘0’ is not a valid identifier start char vendor.js:3279  
randotron\_0.7834251932799816:8:1: ‘)’ expected vendor.js:3279

Here’s a link to a screen shot, it looks like the forum wont let me post images because I’m a new user, so

just prepend https:// to this url:  
[dl.dropboxusercontent.com/u/49968823/gridmacer\_errors.png](http://dl.dropboxusercontent.com/u/49968823/gridmacer_errors.png)

I’m guess this has to do with line ending conversions.

It looks like it only happens when I have function declarations in the code like this:

function something(){  
}

Then when I refresh the webpage, it seems this error prevents the level from loading, and the only way I can get it back is if I use the restart button.

---

<div class="post-metadata">

**Author:** ![nick](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/nick/32/784_2.png) [@nick](https://discourse.codecombat.com/u/nick)\
**Post date:** [January 5, 2014, 12:51am UTC](https://discourse.codecombat.com/t/javascript-errors-when-copying-and-pasting-from-external-text-editor/151/2 "2014-01-05T00:51:39Z")

</div>

Hi @tpsjr7–sorry about that newline problem. I’ve started [an issue here](https://github.com/codecombat/codecombat/issues/16) to keep track of it.

I just tried [tweaking some configurations in our ACE editor](https://github.com/codecombat/codecombat/commit/1d223f790b483d629aadcef0c13074e7a299c353)–if you try again now (may need a cache clear), do you still see the problem?

---

<div class="post-metadata">

**Author:** ![tpsjr7](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/tpsjr7/32/8765_2.png) [@tpsjr7](https://discourse.codecombat.com/u/tpsjr7)\
**Post date:** [January 5, 2014, 1:00am UTC](https://discourse.codecombat.com/t/javascript-errors-when-copying-and-pasting-from-external-text-editor/151/3 "2014-01-05T01:00:40Z")

</div>

Thanks, looks like it’s working now.
