JavaFX WebView and markdown rendering...

Tom Eugelink tbee at tbee.org
Fri Jan 5 21:34:33 UTC 2024


I'm missing the part on how the markdown is turned into HTML. Because the WebView cannot render markdown directly...?

Bold in HTML is not done using **, it is done with font-weight (https://www.udacity.com/blog/2021/01/html-css-font-weight.html) or <b> (https://www.w3schools.com/tags/tag_b.asp), so something is turning that ** into actual HTML, and that is not working.



On 2024-01-05 18:45, Davide Perini wrote:
> Hi all,
> I have a simple javafx.scene.web.WebView
>
> code is as simple as this:
>
> WebViewwv =new WebView();
> wv.getEngine().load(webUrl);
> Alert alert = createAlert(title, header, alertType);
> alert.getDialogPane().setContent(wv);
> alert.showAndWait();
>
>
> As you can see the webview loads a webUrl, that web url returns a markdown.
>
> Mark down is correctly rendered, I can see correct headings, links are interpreted correctly like links and are clickable, ecc.
> The only things that seems to not work is the bold text.
>
> Bold text **like this** or __like this__
> is interpreted "like this", without the ** or __
> but it's not bold, it is rendered like a normal text.
>
> Any idea on how to fix it? :)
>
> Thanks
> Davide
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/openjfx-discuss/attachments/20240105/19721645/attachment.htm>


More information about the openjfx-discuss mailing list