By NeoID on
When adding a comment, or writing a new node, I want Drupal to respect whitespace.
Like... if I press return a couple of times I want the output to have the corresponding space between the lines.
Is it possible to do this? I've tried to change the input-filter without any luck...
Comments
Input Filter
In SITE CONFIGURATION=>INPUT FILTER you need to "configure" the input type you are using. Make sure you have "Line break converter" selected under filters. That should solve the problem.
Roxy
It is turned on...
It is turned on... Do I have to update the list of allowed html tags maybe?
pre-tag
The only easy way to have this done, is enclose the comment in
<pre>-tags. Your problem is that the HTML standard requires HTML-renderers to contract spureous whitespace. The only exception is the<pre>-tag for preformatted text. Usually browsers display text in<pre>-tags with a monospaced font, although this can be addressed through CSS.If you don't want your users to enter the
<pre>-tags, you should modify your template files.Mark
Wow.. I didn't know that...
Wow.. I didn't know that... thanks for the info!
What's the easiest way of wrapping the comment-form with pre-tags?
I just noticed that this
I just noticed that this method breaks the smiley module, they are not longer rendered as they should... :<
I can imagine smileys don't
I can imagine smileys don't work anymore. Nor any other kind of formatting. The idea of the
<pre>-tag is that you use "ascii-formatting".If you want to get around using the
<pre>-tag, your users can use the<br>to force a line break in normal HTML. However, the have to enter the<br>-tag themselves.Alternatively, you might want to write your own input filter that replaces every line break the user enters with a
<br>-tag. That will probably be the most user friendly solution.EDIT: Or maybe this module can help you do what you want: http://drupal.org/project/customfilter It allows you to define your own filter rules with regular expressions. I guess you will be able to replace line ends with
<br>-tags (or at least insert<br>-tags.Mark
Edit comment.tpl.php
The markup of comments is done in the template file comment.tpl.php in your theme.
Mark