MailPoet\EmailEditor\Engine\Renderer\ContentRenderer\Postprocessors

Highlighting_Postprocessor{}WC 1.0

This postprocessor replaces <mark> tags with <span> tags because mark tags are not supported across all email clients

No Hooks.

Usage

$Highlighting_Postprocessor = new Highlighting_Postprocessor();
// use class methods

Methods

  1. public postprocess( string $html )

Highlighting_Postprocessor{} code WC 9.8.1

class Highlighting_Postprocessor implements Postprocessor {
	/**
	 * Postprocess the HTML.
	 *
	 * @param string $html HTML to postprocess.
	 * @return string
	 */
	public function postprocess( string $html ): string {
		return str_replace(
			array( '<mark', '</mark>' ),
			array( '<span', '</span>' ),
			$html
		);
	}
}