/** * gets attribute from a tag string */ public static function fixHtmlTagStructure(&$string, $remove_surrounding_p_tags = 1) { if (empty($string)) { return; } // Combine duplicate <p> tags NNText::combinePTags($string); // Move div nested inside <p> tags outside of it NNText::moveDivBlocksOutsidePBlocks($string); // Remove duplicate ending </p> tags NNText::removeDuplicateTags($string, '/p'); if ($remove_surrounding_p_tags) { // Remove surrounding <p></p> blocks NNText::removeSurroundingPBlocks($string); } }