Skip to content

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

@chriskwan

Description

@chriskwan

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions