Hi all,
I am trying to use some span elements to indicate range info of the document. I am using the p mode and have written a plugin to insert spans before and after the paragraphs user has selected and then set the span invisible. In the wyswyg view it seems ok. However in the source view, I found the editor automatically wraps the span with <p>. The source is below:
The result I want is just simple spans that are not in any paragraph (and this is exactly what my plugin has done), like below:
Does anyone know how to avoid the auto-wrap ? Thanks in advance.
I am trying to use some span elements to indicate range info of the document. I am using the p mode and have written a plugin to insert spans before and after the paragraphs user has selected and then set the span invisible. In the wyswyg view it seems ok. However in the source view, I found the editor automatically wraps the span with <p>. The source is below:
<p> aaaaaaaaa</p> <p> <span class="range_start" style="display: none;"><span class="range_id">rangeId</span></span></p> <p> range para 1</p> <p> range para 2</p> <p> <span class="range_end" style="display: none;"><span class="range_id">rangeId</span></span></p> <p> ddddddddddddddddddd</p>
The result I want is just simple spans that are not in any paragraph (and this is exactly what my plugin has done), like below:
<p> aaaaaaaaa</p> <span class="range_start" style="display: none;"><span class="range_id">rangeId</span></span> <p> range para 1</p> <p> range para 2</p> <span class="range_end" style="display: none;"><span class="range_id">rangeId</span></span> <p> ddddddddddddddddddd</p>
Does anyone know how to avoid the auto-wrap ? Thanks in advance.
Re: How to avoid hidden span being wrapped by <p>
Re: How to avoid hidden span being wrapped by <p>
So does it mean CK automatically wraps the inline element with block element like <p>?
Re: How to avoid hidden span being wrapped by <p>
You can alter that setting the enter mode to <br>