Select paragraph and apply style in CKEditor -
when selecting whole paragraph using triple click or shift , cursor key past end of paragraph, if apply block style selection (for example heading or block quote) style applied next paragraph.
is there way of avoiding , applying style selection?
for example:

it's bug (or peculiarity) of ckeditor. problem range object ends @ element following selection
<p>...</p> {[<p>text</p>] <p>}...</p> # [] - selection, {} - range the end of range needs moved:
<p>...</p> {[<p>text</p>]} <p>...</p> i use custom-made toolbar, apply block formats code this:
style = new ckeditor.style element: 'h1' range = editor.getselection().getranges()[0] if not range.collapsed , range.endoffset 0 , range.endcontainer instanceof ckeditor.dom.element range.setendafter range.endcontainer.getprevious() style.applytorange range, editor
Comments
Post a Comment