-
Notifications
You must be signed in to change notification settings - Fork 393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lost empty <br> when edit again #113
Comments
Hi @cesarve77 this is the expected behaviour currently, that is CT strips/trims white space from editable elements unless it's a But your point is a good one as I'm not sure this is the correct behaviour, and in any case it should be consistent and either allow them or strip them on saving out. I'll open this up to feedback from others and have a think about what the correct behaviour should be, but I suspect that Thanks for highlighting this and your English is far better than my attempt at any language other than English! |
I'm unsure about this. At one hand I like everything being trimmed and clean, it kind of forces things to be neat. On the other hand, it feels that linebreaks should be allowed. |
If no one else has a strong opinion on this ATM I'm going to initially ensure that save trims out line breaks so the behaviour is consistent as I believe this is a simpler option for now and wont risk breaking anything. But once that's in place I'll leave the issue open as an enhancement on the basis that I agree long term this behaviour might need to be changed. |
OK the behaviour now is consistent and white space (includeing In future we may revise this behaviour if there is a strong enough argument made that it should be switch to preserver white space, or perhaps as an enhancement we might consider allowing the behaviour to be configured as a setting. |
I think it should be available as a setting. Some applications include a lot of editing on daily basis. E.g add few line breaks, remove few line breaks. I am currently working on such application and it requires this feature. |
@hassanakram I'm inclined to agree, there's an example of the changes we might need to make to support this behaviour on this SO post http://stackoverflow.com/questions/36883079/how-to-preserve-multiple-br-when-no-content-before-or-after-with-contenttools/36954440#36954440 So we'd have a setting of something like |
Hi @anthonyjb, Yes sounds great! |
It's possible the solution there is no longer valid with the current version of CT as it was a valid solution when posting so will check that again later this evening and update the solution if it's not working - it's a bit of a mess of a solution but (if working) it could form the basis of what we're attempting to do. It would be great to get some help on a PR @hassanakram - thank you 👍 - The changes would need making to the |
I've posted an enhancement issue for this here on CE: GetmeUK/ContentEdit#10 |
Ok sure. CoffeeScript won't be a problem, I am already used to it. I will try to look into this later tonight. |
Hi, if I insert
<br>
at the end of a paragraph and I save everything it's ok. but when i click in edit again I lost then.thanks and sorry for my english
The text was updated successfully, but these errors were encountered: