#6456 closed New Feature (wontfix)
Forced Line Breaks
Reported by: | Dannyk | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | |
Keywords: | Cc: |
Description
Hey!
Loving the editor. Is there any way you can have a feature to auto-create line breaks in the text?
Like this feature I'm suggesting, as I type, I put my own returns in here.
Often, when creating emails you only want the text to go a small width.
It would be great to make this force the line breaks into the email.
Thanks!!
Danyk
The below code is only to show how hard this can be and that you shouldn't go that way. The idea may seem simple calculate body width, then calculate element width and if one is larger than other insert new line. The main problem is with calculating current element width. If this is block element its width will be the same as body so width checks don't make any sense.
Actually the only time they return correct result is when elements have float style set. Another problem is when you insert one float div after another - no new line is visible - you have to insert clearing div first then floating div. Then you get all sort of range problems when you e.g. switch to source and back ...
Taking the above into account and that it can work with float elements only this is a won't fix issue.
This is just for tests. Please don't use that code :).
Insert below on page:
Insert below into editor:
Put caret somewhere and press key.