jQuery UI Widgets Forums Editors Editor Create first line indent in paragraph

This topic contains 2 replies, has 2 voices, and was last updated by  Edisson 7 months, 2 weeks ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Create first line indent in paragraph #107013

    Edisson
    Participant

    Hello!
    I create custom functionality in editor and my question is how to implement automatic first line indent (for example for <p> tag).
    Indents in the Editor are already implemented by default but this isn’t exactly I need.

    The thing is that I expect this behavior:
    ” The new text… continues
    continues, continues, continues”

    if I code something like this:

    
    action: function (widget, editor) {
        editor.css('text-indent', '25px');
    }
    

    or this:

    
    action: function (widget, editor) {
        return { command: "inserthtml", value: '<p style="text-indent:25px">Some text</p>' };
    }
    

    This applies to all the lines that we are typing after function is applied like this
    ” The new text… continues
    continues, continues, continues”

    But I want the next line to be without indents.

    Could you be so kind to give us a piece of advice how can we achieve it?

    Create first line indent in paragraph #107067

    Martin
    Participant

    Hello Edisson,

    Please, take a look at the following Example.
    After the function is called an indent is applied only when you add a new line with the Enter key.

    If this is not what you need, could you clarify what is your desired behavior?
    You could also change the lineBreak property to ‘div’. Then an indent would be inserted only when you use the custom tool.

    Best Regards,
    Martin

    jQWidgets Team
    https://www.jqwidgets.com/

    Create first line indent in paragraph #107142

    Edisson
    Participant

    your example works fine but what I need exactly is that after indent of the first line the next line automatically should be without indent.
    is it possible to do with the lineBreak property as you’ve mentioned?

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.