Bug 451989

Summary: markdown backend does not show alt text for links, and doesn't highlight as a link unless there is a URL
Product: [Applications] okular Reporter: jack_sprat <home1>
Component: markdown backendAssignee: Okular developers <okular-devel>
Status: CONFIRMED ---    
Severity: normal CC: aacid, yurchor
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: okularmd no alt text
Kpart markdown web view with alt text
Test file

Description jack_sprat 2022-03-28 10:41:26 UTC
Created attachment 147783 [details]
okularmd no alt text

SUMMARY
markdown backend does not show alt text for links, and doesn't highlight as a link unless there is a URL

Okular 20.04.2-bp153.1.31 for OpenSuse Leap 15.3 (I realise that this is an _old_ version, but it is the current version in the current OpenSuse stable release)

STEPS TO REPRODUCE
1. create markdown file, with link with alt text
`[a test link with link and alt text](https://dummy-link.org.uk "the alt text")`
2. create markdown link with alt text, without URL
`[a test link with link and alt text]( "the alt text")`
3. view in Okular or in Kate with okularmd configured as text/markdown embedded service preference
4. hover mouse over each link

OBSERVED RESULT
the link with URL is highlighted, but doesn't show alt text
the link without URL isn't highlighted, and also doesn't show alt text

EXPECTED RESULT
both links are highlighted and alt text is visible on both

SOFTWARE/OS VERSIONS
Operating System: openSUSE Leap 15.3
KDE Plasma Version: 5.18.6
KDE Frameworks Version: 5.76.0
Qt Version: 5.12.7
Kernel Version: 5.3.18-150300.59.49-default
OS Type: 64-bit
Processors: 16 × AMD Ryzen 7 4800H with Radeon Graphics
Memory: 15.1 GiB of RAM


ADDITIONAL INFORMATION
see screen grans comparing rendering with okularmd and Markdown Viewer KPart
Comment 1 jack_sprat 2022-03-28 10:42:19 UTC
Created attachment 147784 [details]
Kpart markdown web view with alt text
Comment 2 jack_sprat 2022-03-28 10:45:48 UTC
(In reply to jack_sprat from comment #0)
> Created attachment 147783 [details]
> okularmd no alt text
> 
> SUMMARY
> markdown backend does not show alt text for links, and doesn't highlight as
> a link unless there is a URL
> 
> Okular 20.04.2-bp153.1.31 for OpenSuse Leap 15.3 (I realise that this is an
> _old_ version, but it is the current version in the current OpenSuse stable
> release)
> 
> STEPS TO REPRODUCE
> 1. create markdown file, with link with alt text
> `[a test link with link and alt text](https://dummy-link.org.uk "the alt
> text")`
> 2. create markdown link with alt text, without URL
> `[a test link with link and alt text]( "the alt text")`
> 3. view in Okular or in Kate with okularmd configured as text/markdown
> embedded service preference
> 4. hover mouse over each link
> 
> OBSERVED RESULT
> the link with URL is highlighted, but doesn't show alt text
> the link without URL isn't highlighted, and also doesn't show alt text
> 
> EXPECTED RESULT
> both links are highlighted and alt text is visible on both
> 
> SOFTWARE/OS VERSIONS
> Operating System: openSUSE Leap 15.3
> KDE Plasma Version: 5.18.6
> KDE Frameworks Version: 5.76.0
> Qt Version: 5.12.7
> Kernel Version: 5.3.18-150300.59.49-default
> OS Type: 64-bit
> Processors: 16 × AMD Ryzen 7 4800H with Radeon Graphics
> Memory: 15.1 GiB of RAM
> 
> 
> ADDITIONAL INFORMATION
> see screen grans comparing rendering with okularmd and Markdown Viewer KPart

*screen grabs
Comment 3 jack_sprat 2022-03-28 11:07:18 UTC
I mostly use the markdown viewer as a Kate file preview backend because it provides a KPart file menu with PDF export, whereas the [Markdown Viewer KPart](https://invent.kde.org/utilities/kmarkdownwebview#introduction) offers only an Edit menu and no save or export options.

(I note that Markdown isn't turned off for KDE bugzilla...)
Comment 4 Albert Astals Cid 2022-03-28 16:32:50 UTC
Please attach such a file
Comment 5 Yuri Chornoivan 2022-03-28 16:34:45 UTC
Created attachment 147797 [details]
Test file

Test file. Personally, I do not see what we can do here.
Comment 6 Albert Astals Cid 2022-03-28 17:07:59 UTC
We do show a different cursor in that area, so we do recognise there's a link, so it seems it could be fixable (without having had a look at all)