Unwanted paragraph tags and line break tags added

daneesia - August 14, 2007 - 06:29

Hi all.

I am experiencing a strange problem: unwanted line breaks are being inserted into my nodes when none are present, regardless of the entry method (rich text or standard using the TinyMCE module). If it matters, I am using Drupal 5.2.

The best way I can explain this is with an example. The following entry:

Choose the appropriate item from the list: <dl><dt><a href="/user/me/track" title="My posts">My posts</a></dt><dd>Some description</dd><dt>...</dt><dd>...</dd></dl>

Becomes this:

<div class="content">
<p>Choose the appropriate item from the list:<br /><br /><dl><br /><dt><a href="/user/me/track" title="My posts">My posts</a></dt><br /><dd>Some description</dd><br /><dt>...</dt><br /><dd>...</dd><br /></dl><br />  </div>

Note: there are NO line breaks in the text entry screen. (I double-checked this in a text editor by turning line wrap off).

Any ideas?

Thanks in advanced.

Dan

turn it off

dman - August 14, 2007 - 06:53

If you want to take full control of your code without it trying to be 'nice' to you like that, just turn off the line break filter (on by default) for that input format.
Note that this means that all pages made with that filter will no longer get their automatic line breaks, but if you are using a WYSIWYG anyway, that shouldn't be a problem.

.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/

Thanks Dan

daneesia - August 14, 2007 - 07:07

That seemed to work, but isnt't this some sort of bug with the code.

I mean if I personally had inserted line breaks anywhere, I would expect it to show up in the code.

But if I insert one long string, I do not expect this behavior.

They seem to have some sort of rule set up that says insert a line break if you encounter any sort of list.

Maybe I should submit this as a bug?

What filter are you using with tinymce?

keylope - August 14, 2007 - 07:15

This might not be related, but I've found that when I install TinyMCE, I make a new filter that doesn't do anything. I usually label it No Filter and make that the default filter. Sometimes using TinyMCE and having a filter will cause your output to behave in strange ways.

Hopefully that might help!

Filter for TinyMCE?

daneesia - August 14, 2007 - 07:42

Hi Greg.

I didn't exactly follow your post. Can you be more specific?

Thanks,

Dan

as in the README...

dman - August 14, 2007 - 07:47

Agreed, the install instructions for all the WYSIWYG tools do (or at least should) explain that they operate best on non-filtered input formats, and that's a step you should find in the README. Yep, it's documented there

As for why it happened as described (and you are positive that there was really no whitespace in the lines that got broken) it's a matter of finding where in the insanely 'clever' paragraph-breaking algorithm that got triggered. Not me.

I've not seen it happen when using plain-code input + default line breaks, so I suspect it's either a side-effect or misconfiguration of TinyMCE

.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/

Never mind...figured out what your are talking about...

daneesia - August 14, 2007 - 07:52

Hi Greg.

Never mind...I figured out what you were talking about and that seemed to work.

Thanks again all.

Dan

Glad that fixed it!

keylope - August 14, 2007 - 07:58

Glad that fixed it!

 
 

Drupal is a registered trademark of Dries Buytaert.