If I create content, doesn't matter what type, and I use the horizontal rule tag, <hr/> or <hr>, the post loses all the carriage returns that I've typed. What also bad is if the <hr> falls after the <--break--> for the teaser, the teaser will look fine (all CR/LF accounted for) but the full body post will be mangled.

I'm using Drupal 4.4.2 (noticed this in all 4.4.x though) and Marvin2k theme. I've checked MySQL and the records are fine. Tried multiple themes (Chameleon and xTemplate) with the same problem. Also Drupal will honor a <br> where a CR/LF should be, which is a quick fix, but it gets annoying having to type that all the time.

Anybody else notice this? Is this a bug? Or a problem with multiple 3rd party modules? I've tried disabling some of them (fixenties, urlfilter) which I thought might be effecting it. Nothing helped though.

-Chris

Comments

Steven’s picture

Drupal's auto-break feature tries to see if you used your own break tags, or if you need them made.

Some tags trigger a change in behaviour. To fix this for your case, open up modules/filter.module, search for 'strip_tags' and add


to the list of tags on the same line.
cman’s picture

Ok that did indeed fix it. I added <hr/> to "strip_tags" and it now breaks where I have CR/LF. However, now where I had hr … CR/LF, I now have an hr … br … CR/LF, if that makes sense. Which, I must add, seems like expected behavior with that auto-break feature.

I guess my next question is why? I have Drupal set up to not filter any HTML, so why is Drupal trying to interrupt what I "said" versus what it thinks I meant to "say"? I would expect Drupal to display my post verbatim. It seems like a big no no in interactive design.

Also, I hate having to modify modules, because I then have to remember when I upgrade to re-edit the module. I think a config option in the filters module would be an order, since if you use a lot of markup, you'd be modifying this quite often.

No disrespect to the Drupal gods, just an observation. I'm a bit uneducated when it comes the the inner workings of Drupal.

-Chris

Steven’s picture

I'm actually working on that particular feature for the next Drupal version.

The new behaviour provides a toggle, and also adds breaks and paragraphs in a much more intelligent fashion.

cman’s picture

Sounds great, as I just ran across a similar issue with ordered lists. Had to add those tags (<ol> and <li>) to "strip_tags" as well so I'm really looking forward to your updated code!

-Chris

cman’s picture

Just wanted to say thanks Steven for the help. Don't think my previous post conveyed that too well.

-Chris