Top Methods
jdk.internal.org.commonmark.renderer.html

public Interface HtmlNodeRendererContext

Known Direct Implementers
jdk.internal.org.commonmark.renderer.html.HtmlRenderer.RendererContext
Imports
jdk.internal.org.commonmark.node.Image, .Link, .Node, java.util.Map

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

an encoded URL (depending on the configuration)
encodeUrl
(String
to be encoded
url
)

public Map<String, String>

Returns:

the extended attributes with added/updated/removed entries
extendAttributes
(Node
the node for which the attributes are applied
node
,
String
the HTML tag name that these attributes are for (e.g. h1, pre, code).
tagName
,
Map<String, String>
the attributes that were calculated by the renderer
attributes
)

Let extensions modify the HTML tag attributes.

public String

Returns:

HTML that should be rendered for a soft line break
getSoftbreak
()

public HtmlWriter

Returns:

the HTML writer to use
getWriter
()

public void
render(Node
the node to render
node
)

Render the specified node and its children using the configured renderers.

public boolean

Returns:

whether HTML blocks and tags should be escaped or not
shouldEscapeHtml
()

public boolean

Returns:

true if the UrlSanitizer should be used.
shouldSanitizeUrls
()

public UrlSanitizer

Returns:

Sanitizer to use for securing Link href and Image src if shouldSanitizeUrls() is true.
urlSanitizer
()

Method Detail

encodeUrlback to summary
public String encodeUrl(String url)
Parameters
url:String

to be encoded

Returns:String

an encoded URL (depending on the configuration)

extendAttributesback to summary
public Map<String, String> extendAttributes(Node node, String tagName, Map<String, String> attributes)

Let extensions modify the HTML tag attributes.

Parameters
node:Node

the node for which the attributes are applied

tagName:String

the HTML tag name that these attributes are for (e.g. h1, pre, code).

attributes:Map<String, String>

the attributes that were calculated by the renderer

Returns:Map<String, String>

the extended attributes with added/updated/removed entries

getSoftbreakback to summary
public String getSoftbreak()
Returns:String

HTML that should be rendered for a soft line break

getWriterback to summary
public HtmlWriter getWriter()
Returns:HtmlWriter

the HTML writer to use

renderback to summary
public void render(Node node)

Render the specified node and its children using the configured renderers. This should be used to render child nodes; be careful not to pass the node that is being rendered, that would result in an endless loop.

Parameters
node:Node

the node to render

shouldEscapeHtmlback to summary
public boolean shouldEscapeHtml()
Returns:boolean

whether HTML blocks and tags should be escaped or not

shouldSanitizeUrlsback to summary
public boolean shouldSanitizeUrls()
Returns:boolean

true if the UrlSanitizer should be used.

Since
0.14.0
urlSanitizerback to summary
public UrlSanitizer urlSanitizer()
Returns:UrlSanitizer

Sanitizer to use for securing Link href and Image src if shouldSanitizeUrls() is true.

Since
0.14.0