JavaFX WebView and markdown rendering...
Davide Perini
perini.davide at dpsoftware.org
Sat Jan 6 12:22:04 UTC 2024
I think that the webview itself is able to turn the markdown into
something that is correctly rendered.
[this text](http://acme.org)
for example is correctly turned into a clickable link, where the text of
the link is "this text" and the click opens the acme.org website.
I'm not really into the webview implementation...
Il 05/01/2024 22:34, Tom Eugelink ha scritto:
> 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/20240106/124d13bb/attachment-0001.htm>
More information about the openjfx-discuss
mailing list