Simon ([personal profile] swaldman) wrote in [site community profile] dw_dev 2016-10-02 06:53 am (UTC)


However, think we have a problem with the interaction between the RTE and the "add br tags for linebreaks" functionality, and I don't think it's one that can be solved in a way that pleases absolutely everybody.

The more-elegant way that the RTE now deals with HTML that was entered in raw view means that it is now corrected and prettified, so that a round-trip HTML->RTE->HTML finishes with something different than when it started (paragraph tags are added, new lines and intents are added, and so forth).

But the system that converts newlines into < br > tags has no way to tell between meaningful newlines that were added by the user, and syntactically non-meaningful newlines that were added by the RTE the previous time around. The RTE will add < br > tags for newlines that it itself created, meaning that multiple round-trips can have really unexpected results. See this video for a demonstration:

This is A Problem IMHO, and I can't see any way of making it work intuitively for everybody with the currently desired behaviour, at least without very complex kludges. (this doesn't mean there isn't a way, just that I can't think of one)

A suggestion: Would it be acceptable to only add a < br > tag for a *double* newline, not a single one? This would require a change from those who use the auto-newlines feature (I confess I am not one of them), but it is a new behaviour that would be familiar to some from other markup languages (e.g. LaTeX, Markdown).

Line one

Line Two

would be changed to

Line one< br >
Line Two

or perhaps

Line one
< br >
Line Two

which would still be readable HTML but would remove the "already processed" double newline and avoid having it acted upon again, and I reckon (hopefully?) make multiple roundtrips between RTE and HTML modes a safe thing to do.

Post a comment in response:

Identity URL: 
Account name:
If you don't have an account you can create one now.
HTML doesn't work in the subject.


If you are unable to use this captcha for any reason, please contact us by email at

Notice: This account is set to log the IP addresses of everyone who comments.
Links will be displayed as unclickable URLs to help prevent spam.