<mark> search highlights) into
plain JavaFX nodes, with no dependency on javafx.web.
Region preview = HtmlToNode.render(citationHtml, HtmlRenderOptions.defaults() .withLinkHandler(NativeDesktop::openBrowserShowPopup)); scrollPane.setContent(preview);
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static List | |
| public static List | Returns: the parsed blocks, in document order; empty for blank input, nevernullthe HTML to parse html, @Nullable String the URI to resolve relative baseUri)href/src values against, or null for noneParses HTML, resolving relative links and image sources against |
| public static Region | Returns: the rendered content, ready to be placed in aScrollPane or any other parentthe HTML to render html)Parses and renders HTML with |
| public static Region | Returns: the rendered content, ready to be placed in aScrollPane or any other parentthe HTML to render html, HtmlRenderOptions rendering options options)Parses and renders HTML in one step, resolving relative URLs against
|
| public static Region | Returns: the rendered content, ready to be placed in aScrollPane or any other parentthe blocks to render blocks, HtmlRenderOptions rendering options options)Renders an already parsed block model, e.g. to render the result of |
| public static String | Returns: the stylesheet URL in the form accepted byParent#getStylesheets()URL of the built-in stylesheet (already attached to rendered roots). |
| public static String | Returns: the text content with paragraph breaks, list markers and tab-separated table cellsthe HTML to convert html)Extracts readable plain text, comparable to the DOM's |
| public static String | Returns: the text content with paragraph breaks, list markers and tab-separated table cellsthe blocks to convert blocks)Extracts readable plain text from an already parsed block model. |
| HtmlToNode | back to summary |
|---|---|
| private HtmlToNode() | |
| parse | back to summary |
|---|---|
| public static List Parses HTML into the renderer-independent block model. | |
| parse | back to summary |
|---|---|
| public static List Parses HTML, resolving relative links and image sources against | |
| render | back to summary |
|---|---|
| public static Region render(String html) Parses and renders HTML with | |
| render | back to summary |
|---|---|
| public static Region render(String html, HtmlRenderOptions options) Parses and renders HTML in one step, resolving relative URLs against
| |
| render | back to summary |
|---|---|
| public static Region render(List<Block> blocks, HtmlRenderOptions options) Renders an already parsed block model, e.g. to render the result of
| |
| stylesheet | back to summary |
|---|---|
| public static String stylesheet() URL of the built-in stylesheet (already attached to rendered roots). Add it to a scene only when styling nodes that were re-parented out of the rendered tree.
| |
| toPlainText | back to summary |
|---|---|
| public static String toPlainText(String html) Extracts readable plain text, comparable to the DOM's | |
| toPlainText | back to summary |
|---|---|
| public static String toPlainText(List<Block> blocks) Extracts readable plain text from an already parsed block model. | |