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

avoid injecting xrefs inside other xrefs #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

danc86
Copy link

@danc86 danc86 commented Jun 27, 2018

In my project, I wanted to make a link to another project's issue, like this:

`Greenwave issue #126 <https://pagure.io/greenwave/issue/126>`_

but this extension was still picking up on the #126 portion of the reference and converting that into a reference inside a reference.

I don't think it ever makes sense to produce nested links like that, so this patch makes the extension just skip reference nodes entirely (in the same way it skips literal nodes).

@@ -135,6 +135,9 @@ def apply(self):
if isinstance(parent, (nodes.literal, nodes.FixedTextElement)):
# ignore inline and block literal text
continue
if isinstance(parent, nodes.reference):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks safe to add 👍

I had to add it to my fork

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

Successfully merging this pull request may close these issues.

2 participants