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

Value method does not return styling when styling is applied to all text in the editor #58

Open
chriskwan opened this issue Mar 1, 2015 · 0 comments

Comments

@chriskwan
Copy link
Contributor

If you apply styling to all of the text in an editor and then call the value method, you will not get the styling because it is applied to the editor div instead of to a span within the editor.

A possible fix is to have another inner div within the editor, whose innerHTML we return instead of that of the editor itself.

Examples:

Note: arte = $(".editor").Arte()

Bolding all of the text in the editor:

arte.get(0).value() returns "Please enter text ..."

$(".editor")[0].innerHTML is <div contenteditable="true" class="" style="height: 200px; width: 300px; overflow: auto; border: 1px dashed gray; font-weight: bold;">Please enter text ...</div>

Bolding only the word enter:

arte.get(0).value() returns "Please <span style="font-weight: bold;">enter</span> text ..."

$(".editor")[0].innerHTML is <div contenteditable="true" class="" style="height: 200px; width: 300px; overflow: auto; border: 1px dashed gray;">Please <span style="font-weight: bold;">enter</span> text ...</div>

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

No branches or pull requests

1 participant