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

{ref}link <target> syntax doesn't work if broken with a newline #169

Closed
asmeurer opened this issue Jun 17, 2020 · 7 comments · Fixed by #449
Closed

{ref}link <target> syntax doesn't work if broken with a newline #169

asmeurer opened this issue Jun 17, 2020 · 7 comments · Fixed by #449
Labels
upstream This issue requires an upstream dependency fix

Comments

@asmeurer
Copy link
Contributor

For example

{ref}`Name <target>`

works, but

{ref}`Name
<target>`

does not. It just produces

{ref}Name <target>

in the resulting document.

This is annoying because I typically text wrap my Markdown in my editor to 80 characters, and this happens automatically on spaces. Virtually every other Markdown syntax works when broken along newlines, so this is presumably just an oversight.

@asmeurer asmeurer added the bug Something isn't working label Jun 17, 2020
@chrisjsewell
Copy link
Member

Hey @asmeurer, well this is probably just more general to all roles: https://github.com/executablebooks/markdown-it-py/blob/c5be8d9af46f8e9484cacead123acfae25d89086/markdown_it/extensions/myst_role/index.py#L8

At least for now, what about just using?

[Name
](target)

@asmeurer
Copy link
Contributor Author

I think I was trying to use a more specific autodoc thing like func instead of ref so I had to use the {ref} syntax.

@chrisjsewell
Copy link
Member

I think I was trying to use a more specific autodoc thing like func instead of ref so I had to use the {ref} syntax.

[Name](target) should still work though if the target is a func, since it uses the any role logic to look through all referencable objects

@asmeurer
Copy link
Contributor Author

I guess it does work for the example in my docs. In general though, you sometimes have to specify the type if there is an ambiguity with any.

@chrisjsewell
Copy link
Member

I guess it does work for the example in my docs. In general though, you sometimes have to specify the type if there is an ambiguity with any.

True

@chrisjsewell chrisjsewell added enhancement New feature or request and removed bug Something isn't working labels Jul 20, 2020
@chrisjsewell chrisjsewell added wontfix This will not be worked on upstream This issue requires an upstream dependency fix and removed enhancement New feature or request labels Aug 25, 2020
@webknjaz
Copy link
Contributor

I've filed #448 (now closed) when I failed to find this issue. Just wanted to let you know that this is still broken. And yes, I also line-wrap text files for similar reasons. The use-case is pretty valid.

@chrisjsewell
Copy link
Member

Heya, will be fixed with executablebooks/mdit-py-plugins#32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream This issue requires an upstream dependency fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants