, rich text keeps its allowed tags, everything * else is escaped. * * @param mixed $value Stored value. * @param array $field Field node. * @param array $context Display context, see AnswerFormatter::text(). * @return string */ public static function toHtml( $value, array $field, array $context = array() ): string { return AnswerFormatter::html( $value, $field, $context ); } /** * Whether a stored answer is a drawn signature (a PNG or JPEG data URI). * * @param mixed $value Stored value. * @return bool */ public static function isSignatureImage( $value ): bool { return is_string( $value ) && 1 === preg_match( '#^data:image/(png|jpeg);base64,[A-Za-z0-9+/=]+$#', $value ); } }