Body with "text" flavor looses line breaks

Topics: Core, Troubleshooting
Developer
Oct 29, 2011 at 11:01 AM

If the body flavor is "text" then the body text looses line breaks when shown as Details. As far as I understand, this is because there is no IHtmlFilter filter for the text flavor. I think the solution could be a simple filter that turns line breaks into <br>-s or paragraphs. Any work is going on for something like this?

Oct 30, 2011 at 10:05 AM

That's the whole point of text flavour - it's plain text with no encoding. If you want formatting you can use HTML or Markdown, or write your own flavour.

Developer
Oct 30, 2011 at 10:22 AM

I think even the text flavor should preserve this minimal formatting, or better formulated: convert text formatting (I'm really speaking only about line breaks here) to html formatting if displayed. In the Summary display type line breaks are added to text in every flavor anyway.

Oct 30, 2011 at 10:26 AM

Is not the case that you can include html markup in text flavour?

Developer
Oct 30, 2011 at 10:42 AM

You could (but why would want to do that?) from code, but the user can't fortunately, because then an exception is thrown indicating a possibly malicious attempt.

Coordinator
Oct 30, 2011 at 9:14 PM

I think markdown is going to do exactly what you are asking for. Why not use that?

Developer
Oct 31, 2011 at 10:34 AM

Markdown is a step further by providing advanced formatting, but it seems that eventually it will come to the usage of markdown indeed.

What bothered me is that I imagined the text flavor like it's in Notepad: that means, there are the formatting options of plain text, and since we really don't need tabs here, line breaks would be enough alone.

Oct 31, 2011 at 4:24 PM

Plain text is so limiting; no Urls, no images, etc.  - I'm not sure why you'd really want a bodypart simply for plain text. I understood that it was actually so you could write markup, I guess the exception is an error (why isn't the same exception thrown with HTML flavour, since it's just posting the same markup?)

Incidentally, what's wrong with the TinyMCE or CKEditor modules that you can't use them?

Developer
Nov 2, 2011 at 6:45 PM
Edited Nov 2, 2011 at 9:44 PM

The initial idea was to have the same level of formatting (i.e. nothing past line breaks) as Comments. Now that it can happen that Comments would change and an additional level of formatting won't hurt, we'll go with Markdown.

Thanks both of you for the help!