For node types article (=story) and blog I need to convert all line breaks in database body field, all \n and \n\n ... to
and

and so on.

Where can this replacement be done in PHP? hook_form_alter or where is the place to input this code? Some code examples? Thanx.

Comments

drupalfan2’s picture

edit:

... convert to <br /> and <p>

twod’s picture

Status: Active » Closed (won't fix)

See my reply in #730542: Newline conversion for Filtered HTML for a link to a snippet you can run to fix all body fields (including teasers) without having to implement a hook and have it run each time.
We won't put PHP code like that in Wysiwyg module to run on each WYSIWYG-enabled field because we can't know the location of all of them. We'd need to target the standard node fields, CCK and every other field where markup content could possibly exist- by all modules out there.