-1

When i am passing HTML to a CKEditor instance, a P tag is being inserted within the HTML producing unexpected results.

For example, with the following code:

CKEDITOR.instances["myEditor"].setData("<div>1</div><div>2</div>");

the editor does not display them as block elements (it outputs as "12" inline). Calling getData() and i see the HTML is reformatted incorrectly as:

"<div>
<p>
    1</div><div>2</div></p>
" 

I've played with the enterMode configuration based on some research but haven't found a magic combination. Any suggestions? (I am using 3.6.5)

4

1 に答える 1

0

私はそれを理解しました-貼り付け時にいくつかのタグを取り除くために正規表現を使用しており、これも初期値に影響を与えていました。

于 2012-11-09T16:47:30.030 に答える