PATCH: Give Break vs Paragraph Control to end user
| Project: | TinyMCE |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | won't fix |
Jump to:
This applies to 6.x-1.x-dev of the drupal tinymce and 3.2.0.2 of the main tinymce source code.
First, I will explain about the reasons behind this with any references.
Second, I will explain the patches, solutions, and what you need to do (and not do) to get this done properly.
I have a CMS that must be used by certain people who require the enter/return key to produce exactly what their are used to.
Which is, enter = a single new line, not two.
They can handle double-spacing separately.
Next, they preservation of the default paragraph must be retained, therefore the hack of using CSS to force the paragraph to mimic a break is out of the question.
That is to say, a paragraph must work how a paragraph normally works and so must a break, and they must not do the same thing.
Ideally, the logic needs to be:
<enter> = <br>
<shift> + <enter> = <p>
The following issues talk about the same problems, so there are many users who also must have breaks over paragraphs.
http://drupal.org/node/151939
http://drupal.org/node/186547
http://drupal.org/node/183160
http://drupal.org/node/87386
http://drupal.org/node/70612
This proved useful:
http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/force_br_newlines
The problem with those threads are:
1) 151939 is an outdated solution that never made it upstream
2) 186547, using shift+enter is not acceptable (the users in question would have to be trained into using shift+enter, need I say more?)
3) 109177, the solution is no longer present or I am blind; where did this "advanced" disappear to?
4) 183160, was never resolved
5) 87386, "In this case it is the 'normal' way." is only true via brute-force (ie: other parts of the world, many people are used to using thinking that when they hit the enter key it means "enter" and not "enter enter")
6) 70612, the concept of CSS changing a paragraph may work, but I need paragraph's functionality to remain so that I can say "I want enter enter here and only enter there!".
My solution is to take the patch from 151939 and update it to reflect the latest version (3.2.0.2) based on the information from the force_br_newlines page on the upstream website.
The only functionality I did not fix was changing the shift+enter to produce a paragraph.
I made a patch that did just that; however, the insert_para(..) function implimentation currently does not co-exist well with the force break method.
The drupal tinymce patch sets the force_br_newlines to false by default to preserve the current behavior of using a paragraph on enter, please correct the patch if this default is wrong.
Step By Step Solution
1) download the drupal module and extract it to the standard location: websiteroot/sites/all/modules/
2) download the tinymce source code and extract it into the drupal tinymce module: websiteroot/sites/all/modules/tinymce
3) download the patch to your home directory
4) change to the tinymce directory and apply the patch:
cd websiteroot/sites/all/modules/tinymce/
patch -Np0 -i ~/tinymce-add_force_br_option-1.patch5) do not forget to go to your Home › Administer › Site configuration › Input formats location and disable "Line break converter" on all relevant input formats.
*) Note: You may have to clear your webbrowsers cache if you were already looking and and using the tinymce prior to the patch.
At this point, you should now be free to use or not use breaks over paragraphs at your choice and not the choice of anybody else.
That is, you should be free to choose your own beer.
| Attachment | Size |
|---|---|
| tinymce-add_force_br_option-1.patch | 1.82 KB |

#1
You say:
Ideally, the logic needs to be:<enter> = <br>
<shift> + <enter> = <p>
Isn't it more often exactly the opposite - so that pressing the "ENTER" key starts a new paragraph, while pressing "SHIFT"+"ENTER" forces only a new line (within the same paragraph)?
#2
Given that this has been ignored or overlooked for a long time, I am closing as won't fix.