views:

492

answers:

4

Hello everybody. I am using TinyMCE (http://tinymce.moxiecode.com/) in a .NET page. Whenever I load a text

myTMCE.value=mycontent;

I can see that my text gets wrapped in <p></p>. This is not desirable for me, so I am trying to avoid it. Trying to initialize in

        <script>
            tinyMCE.init({
                force_p_newlines: true
            })

        </script>

did not work. Any idea? Thanks in advance, m.

A: 

You could strip <p> tags after the fact using .NET, or alternatively, just use a plain <textarea> field for data entry if that suits what you're trying to do.

pmckenna
I think I'll strip the leading and trailing <p></p> but is a dirty solution.
pomarc
+2  A: 

See this thread and the answer in TinyMCE forum. force_p_newline is a gecko only option (ie FF).

Elazar Leibovich
however afaik force_p_newlines has another pourpose.
pomarc
A: 

TinyMCE adds a whole load of tags to the text - its design goal is to create valid html from arbitrary input (including html input). If you want control over the generated html code, you're better off using another editor.

soulmerge
that's a pity, because tinyMCE works quite well, beside this unwanted behaviour.
pomarc
A: 

Read the FAQ about paragraphs. link text