Textualize / frogmouth

A Markdown browser for your terminal
https://www.textualize.io/
MIT License
2.35k stars 42 forks source link

Crash when wikilink in heading #88

Closed GuutBoy closed 3 months ago

GuutBoy commented 8 months ago

Frogmouth is great, but I noticed it crashes on markdown files if there is a wiki style link in a heading where the path starts with a /.

Example:

# Heading 1

## Heading 2 [[/test.md]]

results in error:

MarkupError: closing tag '[/test.md]' at position 21 doesn't match any open tag

This is in frogmouth 0.9.1 (Textual v0.41.0)

davep commented 8 months ago

I would imagine there's a couple of things going on here, the main one being that frogmouth doesn't currently support any sort of wiki-style extension to Markdown files (see #21). On top of that the error itself would suggest that such a link is being seen as Rich markup (which might in turn suggest that something would need to be done in the Textual Markdown widget).

GuutBoy commented 8 months ago

Understandable that not all markdown extensions can be fully supported.

I wonder though if there is some way to at least make the program fail a little more gracefully so it just doesn't crash entirely.

davep commented 8 months ago

I wonder though if there is some way to at least make the program fail a little more gracefully so it just doesn't crash entirely.

Oh, for sure, hence:

On top of that the error itself would suggest that such a link is being seen as Rich markup (which might in turn suggest that something would need to be done in the Textual Markdown widget).

That is, I suspect this might actually be something to first check in Textual's widget.

GuutBoy commented 8 months ago

You are right. It seems to be a bug in Textuals Markdown Widget. I reported the bug on their issue tracker. https://github.com/Textualize/textual/issues/3689

davep commented 8 months ago

Awesome; thanks for raising that. I'll keep this open too for the duration.

davep commented 3 months ago

Fixed via https://github.com/Textualize/textual/issues/3689