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:

selecting line triple click (in blue) , applying style

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

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -