1

Topic: How can I disable <p> Tag?

Hi guys,

is there a way to disable the paragraph tag (<p>). I know that I can make a blank line if I push SHIFT + ENTER. But for me thats no real solution. I'm using TinyMCE successfully for some of my customers and those can't handle with that solutions.

Is there a hack or anything else that I can disable that? I don't want any <p> only <br /> should be made.

Thanks for answers ahead!

chameleon

2

Re: How can I disable <p> Tag?

I don't know how many times I told people to:
1) Check the manual
2) Search the forums
3) Once done 1 & 2, THEN post on the forums.

anyway, what you are looking for is force_br_newlines & force_p_newlines:

force_br_newlines : true,
force_p_newlines : false

3

Re: How can I disable <p> Tag?

*crying*

Best regards,
Spocke - Main developer of TinyMCE

4

Re: How can I disable <p> Tag?

better be tears of joy.

5

Re: How can I disable <p> Tag?

Nah, I'm crying because people don't understand that P tags where invented for a reason and that the extra gap between lines can be avoided with a simple CSS trick. But since I been saying that to many times, I didn't want to say it once more. smile

Best regards,
Spocke - Main developer of TinyMCE

6

Re: How can I disable <p> Tag?

Spocke,

TinyMCE is a wonderful, powerful tool.  I tip my hat to you and the rest of your team for what you've accomplished in developing such a useful program.

However, I've been somewhat surprised at the attitude that I often sense from the development team when they encounter certain questions here in the forums.

Let me speak plainly: When user after user of your program has the same question, or the same problem, then you can either blame the users, or look in the mirror and realize that maybe you and your team are not doing something right.  Blaming the users is like a shoe manufacturer blaming customers for getting blisters when they wear the manufacturer's shoes.

As I said earlier, TinyMCE is an outstanding contribution to the open source community.  Yet I've been shocked at how hard it is to get the program to do what it's really intended to do: Give non-technical users a familiar interface for entering formatted text into a web-based application.

Indeed, after weeks of working with the program, my colleagues and I still can't get it to do basic things reliably.  We've gotten over the initial hurdles of the extra space in front of new paragraphs.  We've even figured out how to insert images into TinyMCE-created content in a somewhat user-friendly way.  But the program still occasionally strips out lines between paragraphs for no apparent reason.  And that's just one of the numerous issues we're still facing with the program.

So, sure, you can blame chameleon and all the others for being too stupid to use the program correctly.  Or you can take a more user-oriented approach and ask yourself: What can we do to make it so that these questions are very, very unlikely to come up.

Good luck!

7

Re: How can I disable <p> Tag?

Thanks for the feedback.

Point taken, but in this case it's not a issue of TinyMCE but the whole concept of P tags vs BR for linefeeds in HTML. I can agree that our maunals isn't fantastic and we should give users more examples on how to configure basic problems.

But the end line is that we focus this project on developers needing to integrate TinyMCE into their own CMS or other online systems so we have some "demands" on the knowlege level of the user base you need for example have a basic understanding of HTML and Javascript without that you are pretty much screwed when it comes to integration.

We can not provide to detail explainations on how to proceed with various tasks since it would A take to much time to write and reduce the time we spend on coding on TinyMCE B why explain things people can learn from other locations such as basic HTML or Javascript there are far better resources out there.

I think we also need to explain more why we do things in specific ways. Lots of confusion and frustration on the forum seems to be around issues that we are forced to do since the build in logic in the browsers are buggy or not flexible enough. One example of this is the cleanup engine, this was required since IEs default HTML serializer is far from W3C standard, not many users know why we have that and get frustraded over the fact that it "alters my code" or "makes my paths absolute", we do this on purpose since the default result would be worse.

You need no instructions on how to put on a sho, the sho manufacturer doesn't provide detailed instructions on how to tie the shoelaces, or maybe they do, I have never asked. smile

Best regards,
Spocke - Main developer of TinyMCE

8

Re: How can I disable <p> Tag?

Hi guys,

We've just tried:

force_br_newlines : true,
force_p_newlines : false

However, we were _not_ able stop paragraph/double space creation on hitting enter inside a paragraph. Is force_br_newlines=true meant to insert <br/>'s inside a <p>?

Setting force_p_newlines=false effectively stops a paragraph being created when a user starts off with no styles (that is when the style drop down reads --Format--). However, we also want disable paragraph creation _within_ a paragraph. Is this possible?

We do not want to use the CSS hack because it will make the rendering inside the editor inconsistent with the normal rendering of <p> when the page is saved.

Cheers,
Dave

9

Re: How can I disable <p> Tag?

I'm using TinyMCE for the first time, and may I comment that I think its fantastic.  The last time I made a cms I used Kupu and that was good at the time but nothing compared to what TinyMCE achieves.  I also find the documentation very good, I downloaded it yesterday, read the documentation and had it fully integrated and customized in a few hours, you can't do that with other products.

I've just read this thread and think I should comment.  The CMS I am building is designed to be as close to MSWord as possible.  The use of the <p> is a web concept, and as it can be styled to work more like a line-break, why not just use the line-break instead of styling to no margin and having <p> </p> for purposly added gaps.  On asking computer novices what they conceptually expect when they hit enter, the answer is to start a new line not a new paragraph.  What would be cool though (but I imagine quite complex to implement), would be to convert 2 br's in a row into </p><p> with the enitre content enclosed in <p> ... </p> as that is conceptually begining a new paragraph.

The fact that TinyMCS actually has this option (as most wysiwyg js editors don't bother) shows just how fantastic it is.

10

Re: How can I disable <p> Tag?

P tags is not a web concept. Try hitting return and shift-return in Word. You get a paragraph and a br style element if you switch on the visualization of this characters.
P tags must be there since the web editor will break down other wice lots of odd issues will appare in explorer since it's build on handling P tags and not BR padded rows. The force_br_newlines should not be used at all since it's experimental and it produces bugs in IE. I have even thought from time to time to remove it since it's just to buggy and I will probably never make it non buggy since that would require a lot of extra code in TinyMCE.

Best regards,
Spocke - Main developer of TinyMCE

11

Re: How can I disable <p> Tag?

Are you kidding?????

<p>  is a VERY IMPORTANT TAG

For those who just don't know... use  [SHIFT][ENTER] to 'push' a <BR>

12

Re: How can I disable <p> Tag?

spocke wrote:

Nah, I'm crying because people don't understand that P tags where invented for a reason and that the extra gap between lines can be avoided with a simple CSS trick. But since I been saying that to many times, I didn't want to say it once more. smile

Hi Spocke

First, thanks for a great piece of software.

Second, please don't remove the support for preventing P tags. The point is we're building an app where users are entering a single paragraph using tinyMCE. We're outputting the outer P tag ourselves when the content is displayed and in our application it's important we don't end up with either multiple or nested Ps

So, when users hit return it MUST use BRs only.

Hope this explains why it's possible to understand web standards and still not want P tags out of the editor

Thanks

Ian Anderson

13

Re: How can I disable <p> Tag?

I second that!

14

Re: How can I disable <p> Tag?

Maybe it will be moved to a plugin. There are very few places br tags are needed as a default for the enter key so if it's a uncommon need then it should not be in the core.

Best regards,
Spocke - Main developer of TinyMCE

15

Re: How can I disable <p> Tag?

spocke wrote:

Maybe it will be moved to a plugin. There are very few places br tags are needed as a default for the enter key so if it's a uncommon need then it should not be in the core.

Hello!
Does such a plugin actually exist? We're exactly having the same issue here..

Kind regards,
Andreas

16

Re: How can I disable <p> Tag?

spocke, really i think you may underestimate the uses people put tinymce (and any other similar editor) to that may indeed require such simple customization as control of br or p tags.

i for example am using your editor in a custom built cms i made which admins a website thats 100% flash based.  yes indeed i dont like 100% flash websites much either but it was already built.  i had to make it work with database driven content which i achived via xml. 

the issue for me is that flash accepts (even the latest version) only a very specific subset of html comments for its dynamic text box element.  controlling what html is generated is therefor vital as what a user sees in their web browser under my editor is not what they will see in flash when the same html is read.

so just to say, i also forward better support of such things! there are definitely people out there using tinymce and other similar editors in many ways which require good strict html output control.


arkid

17

Re: How can I disable <p> Tag?

Shift/enter seems to be the only way to force the behaviour we all desire.  The suggested configuration still inserts <p> tags randomly.  I would surmise that this issue is the number one post in the forum, but it is still not solved.  Shift/enter is not a good solution.   Users expect a cr/linefeed (br). They expect a <p> tag when they highlight the text and select 'Paragraph' in the styles drop-down, as they would insert any other style around a text.  Post-processing is NOT the solution either because it is impossible to differentiate between TinyMCE <p> tags and the user's <p> tags.

forced_root_block : false,
    force_p_newlines : 'false',
    remove_linebreaks : false,
    force_br_newlines : true,
    remove_trailing_nbsp : false,
    verify_html : false,

18

Re: How can I disable <p> Tag?

OK, I'm in the current  tinymce_3_2_1_1

It seems much improved.  However when I set force_p_newlines : 'false
but its still putting a <p> at the top of the block.  I understand paragaph tags when you hit Enter vs. Shift-enter but I haven't hit anything.

Bill Mussatto

19

Re: How can I disable <p> Tag?

read up, read faq.

Best regards,
Spocke - Main developer of TinyMCE

20

Re: How can I disable <p> Tag?

mussatto wrote:

It seems much improved.  However when I set force_p_newlines : 'false
but its still putting a <p> at the top of the block.  I understand paragaph tags when you hit Enter vs. Shift-enter but I haven't hit anything.

To prevent the initial p tags from appearing, you need to add the following line to your init statement:

forced_root_block : ""

21

Re: How can I disable <p> Tag?

Actually, scratch my post above, it's not working for me either. Even with the forced_root_block set to an empty string, MCE insists on wrapping all the content in <p> tags, sometimes adding <p> </p> multiple times at the top which you can't delete without editing the HTML source.

So, it would be nice if someone would explain how to make this work the way the Wiki says it should, because it doesn't.

Last edited by kshock (2009-01-30 05:08:15)

22

Re: How can I disable <p> Tag?

So I guess this is another undocumented bug in TinyMCE as there are no workarounds.

23

Re: How can I disable <p> Tag?

Just tried this and it's working, doesn't add a p tag (tested with Tiny 3.1.1.1). Working in both FF3 and IE7.

24

Re: How can I disable <p> Tag?

forced_root_block : "",
Seems to work for me.   However, <p> are still inserted within paragraph table elements.  So its a partial solution at best. <sigh /> Thanks.

Bill

Bill Mussatto

25

Re: How can I disable <p> Tag?

Just some insight... I too develop CMS for Flash content and require to force_br_newlines. Primarily because i cannot expect clients to act intelligently. My experience as a web developer has lead to one conclusion: Clients, and most laymen users, become dumbed down versions of themselves when placed in front of a website. Things need to be spelled out and EASY. Pressing ctrl+enter for one line break is a concept that's hard to grasp for some users and i can't assume that its an obvious one. This was proven even tonight. It's how i got to this forum post. I recieved an upset email from a client saying that he is getting double line breaks when he updates even after i told him to press ctrl+enter like in word. But now hes happy after putting in the force_br_newlines.