Bug 475198 - Links in markdown show raw markdown rather than a clickable link.
Summary: Links in markdown show raw markdown rather than a clickable link.
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: markdown backend (show other bugs)
Version: 23.08.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
: 473940 475416 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-10-03 23:36 UTC by akb825
Modified: 2023-10-10 10:46 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
File to test the issue (30 bytes, text/markdown)
2023-10-04 09:57 UTC, Yuri Chornoivan
Details
Screenshot of the test file (33.80 KB, image/png)
2023-10-05 01:59 UTC, akb825
Details

Note You need to log in before you can comment on or make changes to this bug.
Description akb825 2023-10-03 23:36:02 UTC
SUMMARY
Links that follow the standard Markdown syntax (e.g. [google](https://google.com)) show the raw markdown rather than a clickable link.

STEPS TO REPRODUCE
1. Edit a Markdown file to add a link, such as [google](https://google.com).
2. Open the Markdown file in Okular.

OBSERVED RESULT
The raw markdown syntax is shown for the link and no part of it is clickable.

EXPECTED RESULT
Only the text within the [] brackets is shown and clicking it goes to the URL between ().

SOFTWARE/OS VERSIONS
Linux: Arch Linux
KDE Plasma Version: 5.27.8
KDE Frameworks Version: 5.110.0
Qt Version: 5.15.10

ADDITIONAL INFORMATION
This is a recent regression. I'm not sure about the exact timing, but likely corresponds with the 23.08 release.
Comment 1 Yuri Chornoivan 2023-10-04 09:57:02 UTC
Created attachment 162082 [details]
File to test the issue

Works fine here. Can you test it with "discount-mkd2html test.md" in your system?

Thanks in advance for your answer.
Comment 2 akb825 2023-10-05 01:59:24 UTC
Created attachment 162092 [details]
Screenshot of the test file

The attached file does not appear correctly. I have attached a screenshot of how it looks for me in Okular.

Browsing around the settings, I noticed the "Configure Backends" options, which has a section for Markdown. Apart from the default font, there's only an "Enable SmartyPants formatting" option, but toggling it doesn't appear to make any difference.
Comment 3 akb825 2023-10-05 02:05:21 UTC
> Can you test it with "discount-mkd2html test.md" in your system?

After installing the discount package and running mkd2html, it displays the link correctly.

Double checking the code for Okular, it appears to have Discount as a dependency in the CMakeLists.txt. Does it use some sort of fallback if Discount isn't found? It's possible that the Arch package is simply misconfigured.
Comment 4 akb825 2023-10-05 02:30:09 UTC
After further investigation, Arch does appear to have a proper dependency on the discount package, and the installed okularGenerator_md.so library is properly linking to libmarkdown.so. However, it looks like on August 27 the discount package was updated from version 2.2.7.d to 3.0.0.a. Okular does appear to have explicit checks for discount 3 to use the new API, but if the issue is limited to the newer version of discount that could explain the difference on your machine and mine.
Comment 5 Bug Janitor Service 2023-10-05 21:35:16 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/okular/-/merge_requests/831
Comment 6 Albert Astals Cid 2023-10-05 21:38:11 UTC
*** Bug 473940 has been marked as a duplicate of this bug. ***
Comment 7 Albert Astals Cid 2023-10-05 21:41:49 UTC
Git commit a998e0ca17da3b12b251f00036d991dca05a06b7 by Albert Astals Cid.
Committed on 05/10/2023 at 23:35.
Pushed by aacid into branch 'master'.

markdown: Fix rendering with discount3

These defines for no longer supported version of discount2 where
breaking discount3

M  +0    -14   generators/markdown/converter.cpp

https://invent.kde.org/graphics/okular/-/commit/a998e0ca17da3b12b251f00036d991dca05a06b7
Comment 8 Albert Astals Cid 2023-10-05 21:52:39 UTC
Git commit 043c3521229704558a6a06081a53bd46baac060a by Albert Astals Cid.
Committed on 05/10/2023 at 23:52.
Pushed by aacid into branch 'release/23.08'.

markdown: Fix rendering with discount3

These defines for no longer supported version of discount2 where
breaking discount3

M  +0    -14   generators/markdown/converter.cpp

https://invent.kde.org/graphics/okular/-/commit/043c3521229704558a6a06081a53bd46baac060a
Comment 9 Yuri Chornoivan 2023-10-10 10:46:41 UTC
*** Bug 475416 has been marked as a duplicate of this bug. ***