Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MarkdownViewer] opening an anchor link results in a crash #3094

Closed
blob42 opened this issue Aug 14, 2023 · 2 comments · Fixed by #3244
Closed

[MarkdownViewer] opening an anchor link results in a crash #3094

blob42 opened this issue Aug 14, 2023 · 2 comments · Fixed by #3244
Assignees
Labels
bug Something isn't working Task

Comments

@blob42
Copy link
Contributor

blob42 commented Aug 14, 2023

With MarkdownViewer clicking on any link that has an anchor link uri/path.md#-someanchor will raise FileNotFoundError.

Anchor links are pretty common in markdown and it's not always possible to control the content of the file being read as long as it is valid md. I was thinking this is more of a bug than an enhancement, it should be at least handled by opening the target file properly.

There is #2941 as a fix proposal, I am willing to fix/update the PR as needed.

2023-08-14.10-31-10.mp4

Makrdown file:

<!-- Instrukt documentation master file, created by
sphinx-quickstart on Mon Jul 10 21:22:32 2023.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive. -->

* [Quickstart](quickstart.md)
  * [Introduction](quickstart.md#introduction)
    * [Custom Agents](quickstart.md#custom-agents)
  * [User Interface](quickstart.md#user-interface)
    * [Console Panel](quickstart.md#console-panel)
    * [Monitor Panel](quickstart.md#monitor-panel)
    * [Agent Output](quickstart.md#agent-output)
    * [Realm Window](quickstart.md#realm-window)
  * [Index Management](quickstart.md#index-management)
  * [FAQ](quickstart.md#faq)
    * [Terminal Colors](quickstart.md#terminal-colors)
    * [Select And Copy](quickstart.md#select-and-copy)
  * [Nerdfonts Icons](quickstart.md#nerdfonts-icons)
* [Installation Guide](install.md)
  * [Minimum requirements](install.md#minimum-requirements)
  * [Installing from source](install.md#installing-from-source)
  * [Extra Dependencies](install.md#extra-dependencies)
@davep
Copy link
Contributor

davep commented Aug 23, 2023

Aiming to fix this for the next release, and #2941 seems like the best approach. We'll get that PR passing tests and I think it'll be good to go.

davep added a commit to blob42/textual that referenced this issue Aug 24, 2023
davep added a commit to davep/textual that referenced this issue Sep 5, 2023
davep added a commit to davep/textual that referenced this issue Sep 5, 2023
…wn file

Fixes the issue reported in Textualize#3094.

There's more to come on this, as rather than just fix that error, we'd also
like to go to the header that the anchor relates to. See Textualize#3094 for an
initial approach to this. This PR builds on the idea in a different way.

But before doing that wider part, this simply starts out by fixing the
reported bug.
@github-actions
Copy link

Don't forget to star the repository!

Follow @textualizeio for Textual updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Task
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants