JavaFX WebView and markdown rendering...
Kevin Rushforth
kevin.rushforth at oracle.com
Sat Jan 6 15:04:27 UTC 2024
Redirecting to openjfx-dev
As I mentioned in my last message (which I sent before reading this), I
think there is a JavaFX bug at work here. Other browsers correctly
render the HTML that GitHub turns the markdown into. JavaFX WebView
renders most of it correctly, but does not render the bold text as bold.
-- Kevin
On 1/6/2024 5:47 AM, Davide Perini wrote:
> Ooops, it was my bad.
> I was loading a markdown from GitHub pages, and it seems that GitHub
> pages automatically translates markdown into HTML
> if the markdown is named like index.md...
>
> Problem solved, it's a GitHub pages one, not a JavaFX one :)
>
> Thanks
> Davide
>
> Il 06/01/2024 13:22, Davide Perini ha scritto:
>> 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/bd123a15/attachment.htm>
More information about the openjfx-discuss
mailing list