Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

 for every space at reload #248

Closed
MariusRumpf opened this issue Jun 18, 2013 · 9 comments
Closed

 for every space at reload #248

MariusRumpf opened this issue Jun 18, 2013 · 9 comments

Comments

@MariusRumpf
Copy link

Browser: Chrome 27
System: OSX 10.8.3

<html>
<head>
    <title>Test Case</title>
    <script src="js/epiceditor.min.js"></script>
</head>
<body>
    <div id="epiceditor"></div>
    <script>var editor = new EpicEditor().load();</script>
</body>
</html>

Typed some text into the editor.
No reload
body:Some written text

If I reload the page it adds an extra  symbol for each space every time. After 5 reloads I would end up with something like this.

After 5 reloads
body:SomeÂÂÂÂÂ&nbsp;writtenÂÂÂÂÂ&nbsp;text

@Gankra
Copy link
Collaborator

Gankra commented Jun 18, 2013

If I head to guess, I'd bet it's because you're not setting your encoding to utf-8 via <meta charset='utf-8'>

If that doesn't fix it, what version of the editor are you using?

@Gankra
Copy link
Collaborator

Gankra commented Jun 18, 2013

To be clear, does this reproduce for you on http://epiceditor.com ?

@OscarGodson
Copy link
Owner

@gankro I can reproduce this in the minified code with or without the meta tag, but not the unminified code. It'd be rad if you could take a look or have time. Unfortunately I can't right now :(

@Gankra
Copy link
Collaborator

Gankra commented Jun 19, 2013

The issue is this line:

content = content.replace(/ /g, '\u00a0');

in _setText.

The minifier is replacing '\u00a0' with " ".

@OscarGodson
Copy link
Owner

Dammit. I think I opened an issue about this before. I'll just manually put it back and push for a hot fix and figure out a "real" fix.

OscarGodson added a commit that referenced this issue Jun 19, 2013
I had to manually edit the version numbers, and I did NOT build with
jake build. Instead I manually edited the .min file.
@OscarGodson
Copy link
Owner

There's a PR in the queue now. efbd1bb should fix your problem. Feel free to pull down the PR and test it out or use it. Should be safe, but I think @gankro will take a look at it before it hits master.

Gankra added a commit that referenced this issue Jun 19, 2013
Ticket #248 - Hotfix for weird characters in minified code.
@Gankra
Copy link
Collaborator

Gankra commented Jun 19, 2013

Fixed by #249

@Gankra Gankra closed this as completed Jun 19, 2013
@Gankra
Copy link
Collaborator

Gankra commented Jun 19, 2013

Note: if you make a change and rebuild, this issue may reappear in your .min.js. We should find a way to resolve this properly.

That said, I only use the .js for various reasons, so this isn't high on my todos.

@OscarGodson
Copy link
Owner

Yep, I'm going to try upgrading uglify or look for another minifier this weekend. I'll need to run the specs against the new minifier / uglify upgrade too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants