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

importFile html content #183

Closed
Awea opened this issue Sep 12, 2012 · 10 comments
Closed

importFile html content #183

Awea opened this issue Sep 12, 2012 · 10 comments

Comments

@Awea
Copy link

Awea commented Sep 12, 2012

I don't know if it's an issue or not but if I try something like this :

editor.importFile('some-file','<h2>Blabla</h2>');

It import the html to editor but it interpret it so I have a h2 title.

@OscarGodson
Copy link
Owner

So, you're saying the code above, for you, is creating an actual H2 like:

Blahbla

and NOT

<h2>Blabla</h2>?

If so, I can't reproduce. This is what I get:

Can you create a JSBin link with a reproducible case?

@Awea
Copy link
Author

Awea commented Sep 12, 2012

I'm using a gem with your editor but I think It's not the latest version of your editor.

@OscarGodson
Copy link
Owner

If you're talking about http://rubydoc.info/gems/epiceditor-rails/0.1.0/frames

It's not the latest, but it looks like it's 0.1.0. That's only 1 release difference from master. I also don't see any changes to importFile really in the release notes: https://github.com/OscarGodson/EpicEditor/wiki/Release-Notes

Can you reproduce this on http://epiceditor.com somehow?

@Awea
Copy link
Author

Awea commented Sep 12, 2012

Okey it come from the browser (Firefox 15.0.1), it work well on chrome (21.0.1180.89)

@OscarGodson
Copy link
Owner

Awh, yes, this is actually pretty bad it looks like. Even if you type <h2>test</h2> it renders it as actual h2 text on refresh. I'll look into hotfixing this.

@Awea
Copy link
Author

Awea commented Sep 12, 2012

Exactly ! I don't know why and I'm curious to know :)

@OscarGodson
Copy link
Owner

Well, more than likely it's because Firefox doesn't support the innerText method like Chrome, IE, etc, so we have a shim to make it try to act like innerText. This is probably where the error is happening.

@OscarGodson
Copy link
Owner

The fix is easy. I need to QA it some more, but all tests are passing and the bug appears to be fixed now and it was in fact something to do with our innerText shim (it wasn't converting < and > back to &lt; and &gt;). I'll try pushing it up today!

OscarGodson added a commit that referenced this issue Sep 13, 2012
…n the editor and instead rendering literal HTML
@OscarGodson
Copy link
Owner

OK! hotfixed! Please test it out on http://epiceditor.com again and see if you can repro. The version number is now 0.1.1.1.

I also cherry-picked this into develop as well.

@Awea
Copy link
Author

Awea commented Sep 13, 2012

It works ! Thanks @OscarGodson :)

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

2 participants