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

Some ReStructuredText links broken in moin2. #1680

Open
gmilde opened this issue Apr 10, 2024 · 0 comments
Open

Some ReStructuredText links broken in moin2. #1680

gmilde opened this issue Apr 10, 2024 · 0 comments
Milestone

Comments

@gmilde
Copy link

gmilde commented Apr 10, 2024

It seems like "simple" links to different Wiki pages fail in text parts written in rST:

Working examples: links with targed specified in rST
(cf. https://moin-20.readthedocs.io/en/latest/user/rest.html#hyperlinks).

Links that work
=============

This is a `hyperlink with included target <WikiLink>`_.

This is a `hyperlink to an explicit target`_.

.. _hyperlink to an explicit target: WikiLink

This is an `anonymous hyperlink to an explicit target`_.

__ WikiLink

This is a link to an implicit target: `links that work`_.

All these links work in standard rST

Now the failing example: A link to a different WikiPage without explicit or embedded target.
This works in the "old" MoinMoin but fails in Moin2:

Here is a link to a MoinMoin page named SecondPage_.

Details:

The reference would typically cause an unknown target error from the docutils parser. This is because there isn't a target in the document named "SecondPage". However, with the MoinMoin parser, the "SecondPage_" reference instead creates a link to a MoinMoin page named "SecondPage".
https://moinmo.in/HelpOnParsers/ReStructuredText section "Unknown Targets"

It seems that a part of the underlying code was transferred to moin2: see the visit_reference() function

However, this code is never reached, as Docutils checks for references without targets earlier (in a "transform") and creates a "system message" describing the problem (With Docutils and Sphinx, the system message is inserted into the output, in moin2 it seems to be shown in the log only.)

If continued support for simple WikiLinks_ is planned, moin2 would need to

  • define a "resolver" function and register it in the "unknown_references_resolvers" hook,
  • adapt the abovelinked visit_reference() function to the upcoming changes in Docutils DTD.
@ThomasWaldmann ThomasWaldmann added this to the 2.0.0c1 milestone Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants