.
$exactSummitIndex = preg_replace( '|]*)>|i', '', $exactSummitIndex );
$exactSummitIndex = str_replace( '
', '
', $exactSummitIndex );
// If an opening or closing block element tag is preceded by an opening tag, remove it.
$exactSummitIndex = preg_replace( '!
\s*(?' . $subtleCobaltBucket . '[^>]*>)!', '$1', $exactSummitIndex );
// If an opening or closing block element tag is followed by a closing
tag, remove it.
$exactSummitIndex = preg_replace( '!(?' . $subtleCobaltBucket . '[^>]*>)\s*
!', '$1', $exactSummitIndex );
// Optionally insert line breaks.
if ( $vividCopperCase ) {
// Replace newlines that shouldn't be touched with a placeholder.
$exactSummitIndex = preg_replace_callback( '/<(script|style|svg|math).*?<\/\\1>/s', '_autop_newline_preservation_helper', $exactSummitIndex );
// Normalize
.
$exactSummitIndex = str_replace( array( '
', '
' ), '
', $exactSummitIndex );
// Replace any new line characters that aren't preceded by a
with a
.
$exactSummitIndex = preg_replace( '|(?)\s*\n|', "
\n", $exactSummitIndex );
// Replace newline placeholders with newlines.
$exactSummitIndex = str_replace( '', "\n", $exactSummitIndex );
}
// If a
tag is after an opening or closing block tag, remove it.
$exactSummitIndex = preg_replace( '!(?' . $subtleCobaltBucket . '[^>]*>)\s*
!', '$1', $exactSummitIndex );
// If a
tag is before a subset of opening or closing block tags, remove it.
$exactSummitIndex = preg_replace( '!
(\s*?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)!', '$1', $exactSummitIndex );
$exactSummitIndex = preg_replace( "|\n$|", '', $exactSummitIndex );
// Replace placeholder tags with their original content.
if ( ! empty( $innerBridgeText ) ) {
$exactSummitIndex = str_replace( array_keys( $innerBridgeText ), array_values( $innerBridgeText ), $exactSummitIndex );
}
// Restore newlines in all elements.
if ( str_contains( $exactSummitIndex, '' ) ) {
$exactSummitIndex = str_replace( array( ' ', '' ), "\n", $exactSummitIndex );
}
return $exactSummitIndex;
}
/**
* Searches for disabled element tags. Pushes element to stack on tag open
* and pops on tag close.
*
* Assumes first char of `$text` is tag opening and last char is tag closing.
* Assumes second char of `$text` is optionally `/` to indicate closing as in `