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

Only parse external link as text if <nowiki/> directly after [ #304

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

xxyzz
Copy link
Collaborator

@xxyzz xxyzz commented Sep 11, 2024

Put <nowiki/> at any other place expands to normal external url link.

Put `<nowiki/>` at any other place expands to normal external url
link.
Copy link
Collaborator

@kristian-clausal kristian-clausal left a comment

Choose a reason for hiding this comment

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

This is correct, but I've mentioned an edge-case that might be relevant.

root = self.ctx.parse("[ <nowiki/> https://quran.com/3/144 3:144]")
text_node = root.children[0]
self.assertEqual(text_node, "[ <nowiki /> ")

Copy link
Collaborator

Choose a reason for hiding this comment

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

I have confirmed that this is correct behavior. In addition to this, doing [https://goo<nowiki/>gle.com test] in the sandbox results in [https://goo^gle.com test] as text with https://goo parsed as an URL, but it seems extremely unlikely that this kind of thing is done on purpose.

@xxyzz xxyzz merged commit 4b37709 into tatuylonen:main Sep 11, 2024
5 checks passed
@xxyzz xxyzz deleted the nowiki_external_link branch September 11, 2024 05:26
This pull request was closed.
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