Class MjRaw
java.lang.Object
dev.jcputney.mjml.component.BaseComponent
dev.jcputney.mjml.component.BodyComponent
dev.jcputney.mjml.component.content.MjRaw
The raw component (
<mj-raw>). Passes through raw HTML content without any wrapping or
transformation.
Security note: mj-raw passes arbitrary HTML directly into the
rendered output, including when position="file-start" is used to inject content before
the DOCTYPE. This makes it an XSS vector when processing untrusted MJML input. Configure a ContentSanitizer to sanitize the inner HTML before it reaches the final output
when handling user-supplied MJML.
-
Field Summary
Fields inherited from class BaseComponent
globalContext, node, renderContext -
Constructor Summary
ConstructorsConstructorDescriptionMjRaw(MjmlNode node, GlobalContext globalContext, RenderContext renderContext) -
Method Summary
Modifier and TypeMethodDescriptionReturns the default attribute values for this component.Returns the MJML tag name this component handles.render()Renders this component to HTML.Methods inherited from class BodyComponent
addBorderStyles, addIfPresent, addIfPresent, buildAttributes, buildResponsiveClass, buildStyle, escapeAttr, escapeHref, getBoxModel, getChildrenByTags, getContentWidth, orderedMap, parseWidth, registerMediaQuery, renderChildren, resolveShorthandSide, sanitizeContent, sanitizeHrefMethods inherited from class BaseComponent
getAttribute, getAttribute, getNode
-
Constructor Details
-
MjRaw
-
-
Method Details
-
getTagName
Description copied from class:BaseComponentReturns the MJML tag name this component handles.- Specified by:
getTagNamein classBaseComponent- Returns:
- the MJML tag name
-
getDefaultAttributes
Description copied from class:BaseComponentReturns the default attribute values for this component.- Specified by:
getDefaultAttributesin classBaseComponent- Returns:
- a map of attribute names to their default values
-
render
Description copied from class:BodyComponentRenders this component to HTML.- Specified by:
renderin classBodyComponent- Returns:
- the rendered HTML string
-