Class HtmlEscaper

java.lang.Object
dev.jcputney.mjml.util.HtmlEscaper

public final class HtmlEscaper extends Object
Utility to escape HTML special characters in attribute values. Used when sanitizeOutput is enabled in configuration.
  • Method Details

    • escapeAttributeValue

      public static String escapeAttributeValue(String value)
      Escapes HTML special characters in an attribute value: &, ", ', <, >.
      Parameters:
      value - the attribute value to escape (may be null or empty)
      Returns:
      the escaped value, or the original value if no escaping is needed