• I am running WP 3.4.2, BBpress 2.1.2, and the latest Graphene theme.
    I am the admin on a poetry board. I would like to change the default behavior of Tiny MCE so that in the Visual editor a return is a line break and not a paragraph (which results in double spacing). I know that shift return gives a simple line break, but I would like to swap these two behaviors. Also many users of the board type up their work in MS word and then paste it into the editor. If they do this in the Visual editor, it becomes double spaced (not if they paste it in the HTML editor). Again, I would like to change this so that the text does not come out double spaced. I found some information in the codex:
    HERE but I am afraid
    that I don’t know enough to be able to use this information. Any help would be appreciated.

Viewing 6 replies - 16 through 21 (of 21 total)
  • Thread Starter Starejosel

    (@starejosel)

    OK, thanks–actually, I do have some hope of doing better using
    br~p to look for p’s that follow a br–would that work?
    Can I do a series of redefinitions with increasingly restrictive selectors? In which order should I put them?

    Thanks again!
    Martin

    You could select a <br/> that is inside a <p> tag but not one that ‘follows’ it, strictly speaking.

    Can I do a series of redefinitions with increasingly restrictive selectors? In which order should I put them?

    Most restrictive last.

    Thread Starter Starejosel

    (@starejosel)

    Can I select a p tag that contains a br tag?

    Thanks again!

    Martin

    Can I select a p tag that contains a br tag?

    No. You can’t have those kinds of conditionals.

    Thread Starter Starejosel

    (@starejosel)

    The solution still doesn’t look great. I’ll leave it open and hope for some new idea. Thanks for all your time and effort.

    Thread Starter Starejosel

    (@starejosel)

    I have been trying some more; here is the latest status:
    (I am presenting it as code to avoid problems with html that is in
    the message):

    the problem is to swap the default behavior and?
    make return give a br tag and?shift return give a p tag.??
    The TinyMCE wiki https://www.tinymce.com/wiki.php/Configuration
    seems to say that is the way to do it is by setting?
    forced_root_block to false.
    
    However, when I tried that using?the
    Advanced TinyMCE Configuration plugin by Andrew Ozz?,
    I found:
    
    If I use it to set?
    forced_root_block to false,?
    nothing?changes.?
    
    If I set?forced_root_block?to true, which I expected
    to do nothing, it breaks the editor:?
    The buttons don't work, and?anything that I type
    into the Visual editor?
    gets wiped out when I switch to html.
    
    If I set?forced_root_block to just a space,
    when I typed in?
    
    test
    test
    test
    test
    
    test
    test
    
    ?it produces the following html:
    
    < >< >test
    <!-- -->
    <div>test</div>
    <div>test</div>
    <div>test</div>
    <div></div>
    <div>test</div>
    <div>test</div>
    <div></div>
    
    which displays as?
    
    < >< >test
    
    test
    test
    test
    test
    test
    
    after submitting.
    
    Finally, if I set?forced_root_block to div,
    when I typed in?
    
    test
    test
    test
    test
    
    test
    test
    
    it produces
    
    <div>test</div>
    <div>test</div>
    <div>test</div>
    <div>test</div>
    <div></div>
    <div>test</div>
    <div>test</div>
    <div></div>
    
    which displays as?
    
    test
    test
    test
    test
    test
    test
    
    and there seems to be no way to produce a break.
    
    I hope that this data is useful.

    Any help would be greatly appreciated.

Viewing 6 replies - 16 through 21 (of 21 total)
  • The topic ‘Tiny MCE defaults’ is closed to new replies.