Summary: | Internal links in markdown documents work incorrectly | ||
---|---|---|---|
Product: | [Applications] okular | Reporter: | Vaso <fuckel> |
Component: | general | Assignee: | Okular developers <okular-devel> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | aacid, nate |
Priority: | NOR | ||
Version: | 20.04.0 | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/kde/okular/commit/b1c02b7e79c8be1716ddba73d92d5792032821c6 | Version Fixed In: | 1.11.0 |
Sentry Crash Report: | |||
Attachments: | attaching the file |
Description
Vaso
2020-05-07 17:02:03 UTC
Created attachment 128313 [details]
attaching the file
Next time attach the file instead of making us do the work to create it, the 5 seconds you save us doing this work, it's 5 seconds we can invest in actually investigating the issue
The HTML we get back from discount (the Markdown library we use) is <h1>TEST LINKS</h1>\n\n<ol>\n<li><a href=\"https://kde.org/\">External link to web site</a></li>\n<li><a href=\"/etc/hosts\">Local link to file</a></li>\n<li><a href=\"#Chapter\">Internal link to chapter</a></li>\n</ol>\n\n\n<div style=\"page-break-after: always;\">\n---end-of-page---\n</div>\n\n\n<h1>Chapter</h1> I'm not convinced that at this point we can actually do anything to figure out that <a href=\"#Chapter\"> refers to <h1>Chapter</h1> I'll ask the discount author ok, using the MKD_TOC flag in discount gives us <a name=\"TEST-LINKS\"></a>\n<h1>TEST LINKS</h1>\n\n<ol>\n<li><a href=\"https://kde.org/\">External link to web site</a></li>\n<li><a href=\"/etc/hosts\">Local link to file</a></li>\n<li><a href=\"#Chapter\">Internal link to chapter</a></li>\n</ol>\n\n\n<div style=\"page-break-after: always;\">\n---end-of-page---\n</div>\n\n\n<a name=\"Chapter\"></a>\n<h1>Chapter</h1> which gives us something to work with Will be fixed by https://invent.kde.org/kde/okular/-/merge_requests/164 Git commit b1c02b7e79c8be1716ddba73d92d5792032821c6 by Albert Astals Cid. Committed on 12/05/2020 at 22:21. Pushed by aacid into branch 'master'. Markdown: Support internal links When processing the <a> elements, store in two maps those that contain an href="#Something" and those with name="Something" then once we've processed them all, go over the first map trying to find itself in the second M +33 -10 generators/markdown/converter.cpp M +3 -2 generators/markdown/converter.h https://invent.kde.org/kde/okular/commit/b1c02b7e79c8be1716ddba73d92d5792032821c6 |