• Hi,

    Found the suggestion that Tiny MCE editor could be hacked to permit line breaks.

    If you use shift-enter instead of enter you should be in luck. Depending on your configuration, you might also have to edit the initialization settings in the js/tinymce/tiny_mce.js file and change these values to reflect:
    this.defParam(“force_br_newlines”, true);
    this.defParam(“force_p_newlines”, false);
    this.defParam(“convert_newlines_to_brs”, true);

    https://www.ads-software.com/support/topic/52958?replies=19#post-289814

    I think I finally figured out which lines to modify, but it doesn’t work. As far as I can tell “shift-return” does absolutely nothing ( i.e. it’s the same as “return”). I think that’s some sort of PC thing.

    Please can someone tell me how do you force line breaks using a Mac?

    (p.s. The WP 2.0.2 installation is on a Linux server and locally on my Mac for testing, neither works.)

Viewing 15 replies - 1 through 15 (of 47 total)
  • Thread Starter ciryaquen

    (@ciryaquen)

    Any other Mac users figure out how to force line breaks in WordPress 2?

    Thread Starter ciryaquen

    (@ciryaquen)

    Actually, I give up. Even disabling the rich text editor won’t stop this thing from stripping out my line breaks.

    How do you un-install this TINY MCE thing so you can just write your own xhtml?

    or do I have to downgrade back to WP 1.5?

    Just disable it.

    As admin, click on Users.

    Scroll to the bottom of the page. Uncheck the box that mentions use RTE editor…

    Thread Starter ciryaquen

    (@ciryaquen)

    I’ve already tried disabling the RTE (i.e. rich text editor). It doesn’t work. The darn thing continues to strip out line breaks and every other suggested work-around to make a line break.

    E.g., I’ve even tried making an invisible class in my CSS and the blasted thing will strip out my invisible paragraphs and spanned text from the posts and pages.

    For example
    <p class="invisible">gosh darn it I want a line break here!</p>

    gets stripped out! Poof! Just removed from the post!

    As the Smiths put it in song years ago it’s “enough to make a shy, bald, buddhist reflect and plan a mass murder”.

    I’d really like to delete this text editor now. If anyone can advise how to get rid of it I will be very grateful.

    Ok, I’ll bite. How did you try to disable it?

    Thread Starter ciryaquen

    (@ciryaquen)

    Hi,

    First method was (as Admin)
    a) In Users > Your Profile> Personal Options deselecting “Use the visual rich editor when writing”
    b) In Options > Writing deselecting all 3 choices under Formatting “Users should use the visual rich editor by default”, “Convert emoticons like ?? and ?? to graphics on display”, “WordPress should correct invalidly nested XHTML automatically”

    It didn’t work on 3 installations: 2 Linux shared hosting sites, and my local OS X copy.

    Second method was
    a) hacking the above mentioned js/tinymce/tiny_mce.js file as described in that linked thread. I deleted the file then ftp’d the modified one to the site.

    edit the initialization settings in the js/tinymce/tiny_mce.js file and change these values to reflect:
    this.defParam(“force_br_newlines”, true);
    this.defParam(“force_p_newlines”, false);
    this.defParam(“convert_newlines_to_brs”, true);

    [snip]

    this.defParam(“remove_linebreaks”, false);’

    The problem is consistent on 2 installations: a Linux shared hosting site and my local OS X copy. It’s as if nothing was changed in the hacked tiny_mce file on the sites compared to the 3rd installation with the un-hacked copy of the file.

    Shift-enter does nothing; that’s some Microsoft thing.

    p.s. forgot to add, I’ve tried inserting a line break in Safari, Firefox, and Opera.

    @ciryaquen: It appears not to be just a Mac or linux thing.

    I’ve been trying to get my arms around this for a while now. Earlier today, I tried #2 you mentioned above and tested in MSIE6 and FF1.5 in Win XP Pro SP2. (I already use method #1).

    Here’s what I tried –

    this.defParam("force_br_newlines", true);
    this.defParam("force_p_newlines", false);
    this.defParam("convert_newlines_to_brs", true);
    this.defParam("remove_linebreaks", false);


    this.defParam("verify_css_classes", false);
    this.defParam("verify_html", true);
    this.defParam("apply_source_formatting", true);
    this.defParam("inline_styles", false);
    this.defParam("trim_span_elements", false);
    this.defParam("convert_fonts_to_spans", true);
    this.defParam("font_size_classes", 'fontSize1,fontSize2,fontSize3,fontSize4,fontSize5,fontSize6,fontSize7');
    this.defParam("font_size_style_values", '');
    this.defParam("doctype", '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
    this.defParam("table_inline_editing", false);
    this.defParam("fix_list_elements", true);
    this.defParam("fix_table_elements", true);

    FMI, here’s the link to the moxiecode reference for the configs above:
    https://tinymce.moxiecode.com/tinymce/docs/reference_configuration.html

    The doctype default was set to html 4.0…? and not even with a DTD using a URL.

    But nothing above helped. I also modified the this.defParam("valid_elements",""); to allow better xhtml markup.

    I wonder if the tiny_mce_gzip.php plays a role, but I can’t find any documentation about the changes made to it for the port to WP and what role it plays.

    My main complaint is the RTE html source editor and the non RTE editor would change my html to use </p> without the opening tag instead of the <br /> I wrote. And it would try to wrap everything into a paragraph.

    Now after the changes I made to tinymce, it doesn’t try to wrap everything in a <p></p> but uses my source div’s as a container for text.

    For example, assume I have a container div and I want to insert text following the opening div tag. Before changes to the tiny_mce.js file, I’d get this garbage with and without the RTE on

    <div id="CSS-P">
    Text for testing </p>
    <h2> blah blah h2 header</h2>
    [other code...]
    </div>

    With RTE on TinyMCE changes the html source like this after uploading the modified tiny_mce.js

    <div id="CSS-P">
    <div id="CSS-P">Text for testing</div>
    <h2> blah blah h2 header</h2>
    [other code...]
    </div>

    when the correct source should be

    <div id="CSS-P">
    <p>Text for testing</p>
    <h2> blah blah h2 header</h2>
    [other code...]
    </div>

    Right?

    The site I’m working on validates because I stopped using <br /> or empty <p> </p> while pasting my code into the “non” RTE form – they’re not well-formed xhtml in the strict sense anyway. It just means more CSS.

    While pasting my html into the “non” RTE is ok for me to develop the blog’s initial look and feel, when the end-user gets it and edits pages, creates new posts, and etc., it appears that the Rich Text Editor, will make a mess of the code.

    Worse case is it disrupts the layout and accessibility.

    Thread Starter ciryaquen

    (@ciryaquen)

    MaineWebwo, I followed the link, but I’m afraid almost everything on that moxiecode site is over my head. I’m an amateur.

    All I know is that I never had this problem with WP 1.5, and that turning off the RTE in WP doesn’t exorcize Tiny MCE’s interference with my code.

    All I want is to use a line break. Why should that be so hard?

    Someone please tell me how to un-install Tiny MCE from WP 2.

    I’m using WP 2.0.2 on a Linux server and use Mac OSX Tiger for admin and have no problem doing line breaks with QuickTags.

    Of course I can only *see* the QuickTags with Firefox, not Safari …

    Anyway to add a line break on a Mac you use Shift-Return. That’s a typical “soft return” (line break) keyboard shortcut found in most design programs as well. I don’t know why it’s not working for you.

    I just checked and when viewing the HTML that the quicktag made, it used <br />. (hope that code made it through … trying to enter the XHTML code for a break tag.)

    AM

    btw I might be confused re quicktags vs rich tag editor. I’m a newbie with a whole week of experience so far.

    By “quicktags” I’m referring to the little icons that appear above the text entry box in the Write > Post page in admin. (is that the same as the rich text editor?)

    But even in Safari where the tags aren’t available, hitting return causes a regular paragraph break and hitting Shift-return causes a line break … at least in my install.

    AM

    Thread Starter ciryaquen

    (@ciryaquen)

    amarie,

    Thanks for the post. Now I wonder if the download of WordPress or as installed is corrupt.

    I also get quicktags with Firefox 1.0.6, Opera 8.52, but not with Safari 1.2.4.

    With all 3 installations (2 with the hacked Tiny MCE file, and one with the default file), shift-return does nothing. No changes in the code, no <br /> inserted. It just strips everything out. I can put in 50 returns, or 50 shift-returns, and it will strip them out.

    It’s maddening!

    Ciryaquen:

    I have the EXACT same problem. I have tried every single “supposed” solution to this problem, including mofifying the Tiny MCE .js file. Nothing works. I am desperate.

    Have you found a solution? I’ll appreciate your help.

    Thread Starter ciryaquen

    (@ciryaquen)

    Hi jwvelez,

    No solution yet.

    I do understand your desperation. I’ve gone from being desperate to to use a line break to a smoldering white hot hatred of Tiny MCE.

    If anyone knows anyone who knows how to code WordPress or this blasted TinyMCE please send them over here where help in removing it is needed.

    Thanks!

    After reading this and your other post I think it’s not TinyMCE that’s causing your trouble.

    By default WordPress run’s the wpautop filter on every post, which (among other things) replaces multiple succesive occurances of newlines or BR tags by a single one.

    You can find it in wp-include/wpautop.php.

    Even though I did not find the wpautop.php file in the wp-includes folder, I managed to find a disable-wpautop.php Plugin for WP that supposedly resolved this issue. It made it worse. Didn’t work for me.

    If anything new comes up, let me know.

Viewing 15 replies - 1 through 15 (of 47 total)
  • The topic ‘Force line break inspite of Tiny MCE editor using a Mac’ is closed to new replies.