You are here

function _shortcode_postprocess_text in Shortcode 7

Same name and namespace in other branches
  1. 6 shortcode.module \_shortcode_postprocess_text()
  2. 7.2 shortcode.module \_shortcode_postprocess_text()
1 call to _shortcode_postprocess_text()
shortcode_filter in ./shortcode.module
Implementation of hook_filter().

File

./shortcode.module, line 387

Code

function _shortcode_postprocess_text($text) {

  //return $text;
  $patterns = array(
    '|#!#|is',
    '!<p>(&nbsp;|\\s)*(<\\/*div>)!is',
    '!<p>(&nbsp;|\\s)*(<div)!is',
    '!(<\\/div.*?>)\\s*</p>!is',
    '!(<div.*?>)\\s*</p>!is',
  );

  /*
   *
   */

  //$replacements = array('!!\\2', '###\\2', '@@@\\1');
  $replacements = array(
    '',
    '\\2',
    '\\2',
    '\\1',
    '\\1',
  );
  return preg_replace($patterns, $replacements, $text);
}