Hi
I am using ckeditor 3.5 and I would like to generate html with the following structure:
I have enterMode = p. If I enter the text "Introduction P...", press enter and type "Introduction P..." the source is as I would expect:
I then created a block style "Introduction Text" with element = 'div' and class='introduction'.
If I select the text and apply the style the <p> tags are changed to <div>:
As an experiment I typed
"Introduction paragraph 1 text Introduction paragraph 2 text" and applied the Introduction Text style. The source was:
I then placed the cursor before the second Introduction and pressed return, expecting each piece of text to be enclosed in <p> tags, inside the <div>. Instead the source was again:
Is there a way to configure ckeditor to allow <p> tags inside <div> tags instead of replacing each <p> with a <div>?
Regards
P
I am using ckeditor 3.5 and I would like to generate html with the following structure:
<div class="introduction"> <p> Introduction paragraph 1 text </p> <p> Introduction paragraph 2 text </p> </div>
I have enterMode = p. If I enter the text "Introduction P...", press enter and type "Introduction P..." the source is as I would expect:
<p> Introduction paragraph 1 text </p> <p> Introduction paragraph 2 text </p>
I then created a block style "Introduction Text" with element = 'div' and class='introduction'.
If I select the text and apply the style the <p> tags are changed to <div>:
<div class="introduction"> Introduction paragraph 1 text </div> <div class="introduction"> Introduction paragraph 2 text </div>
As an experiment I typed
"Introduction paragraph 1 text Introduction paragraph 2 text" and applied the Introduction Text style. The source was:
<div class="introduction"> Introduction paragraph 1 text Introduction paragraph 2 text </div>
I then placed the cursor before the second Introduction and pressed return, expecting each piece of text to be enclosed in <p> tags, inside the <div>. Instead the source was again:
<div class="introduction"> Introduction paragraph 1 text </div> <div class="introduction"> Introduction paragraph 2 text </div>
Is there a way to configure ckeditor to allow <p> tags inside <div> tags instead of replacing each <p> with a <div>?
Regards
P
Re: <p> inside <div>
You have to add the following code to your config.js file:
Customer and Community Manager, CKSource
Follow us on: Facebook, Twitter, LinkedIn
If you think you found a bug in CKEditor, read this!
Re: <p> inside <div>
Re: <p> inside <div>
1) Typed: Introduction paragraph 1 text Introduction paragraph 2 text
2) Selected the text
3) Pressed "Create Div Container" button and added "introduction" to Stylesheet Classes, then pressed OK
4) Put the cursor between "1 text" and "Introduction"
5) Pressed Enter
It gave me the following source code:
Customer and Community Manager, CKSource
Follow us on: Facebook, Twitter, LinkedIn
If you think you found a bug in CKEditor, read this!
Re: <p> inside <div>
Thank you again for your reply. I will investigate your suggestion.
I have also found that it is possible to set up a template with the <div class="introduction"><p>Type your text here</p></div>.
If I type text and press enter a new paragraph is created. The source is:
which is what we require. It may also be easier for users who are not familiar with the create div button.
Regards
P