Support » Fixing WordPress » <BR> stripping problem – Ultimate solving.

  • Hello all those with problems when <*br> (with no *) is stripped.

    Here my solution:

    You need to modify two files:
    1. PHP(backend) file, which proceeds stripping on serverside.
    2. Javascript(frontend) file, which proceeds stripping right in your browser.

    So, lets go:

    1. Find file /wordpress_root/wp-admin/js/editor.js.
    This file is a compact version of human-readable file:
    Find file /wordpress_root/wp-admin/js/

    You do what:

    • edit file /wordpress_root/wp-admin/js/
    • Find line with code:
      pee = pee.replace(/<br \/>\s*<br \/>/gi, '\n\n');

      replace it with

      //pee = pee.replace(/<br \/>\s*<br \/>/gi, '\n\n');

      Btw, this file contains rules for <p> stripping and other. Play with it for your own.

    • b. save it as /wordpress_root/wp-admin/js/editor.js and overwrite it.

    Now move to backend file:

    • a. find file /wordpress_root/wp-includes/formatting.php
    • b. find line:
      $text = str_replace('<br />', '', $text);

      replace it with:

      //$text = str_replace('<br />', '', $text);

    • save it

    Now you modified your backend and frontend.

    Problem solved.

    Tested at 2.9.2 WordPress.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘<BR> stripping problem – Ultimate solving.’ is closed to new replies.