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

Double-backtick links seem broken #88

Closed
mjwillson opened this issue Jan 20, 2016 · 9 comments

Comments

Projects
None yet
2 participants
@mjwillson
Copy link

commented Jan 20, 2016

I'm not sure exactly if/how these were intended to work, but it looks like they're almost managing to do something quite useful. If I have text in docstrings referring to another class in double-backticks, like:

see ``foo.bar``

In the HTML output I see:

see foo.bar

on the package pages, or

see foo.bar

on the (sub)module pages. As in, I see the raw markdown for these links, with that bold formatting.

Note the former would be pretty useful if it was an actual link, as it links to the right page!

@BurntSushi

This comment has been minimized.

Copy link
Contributor

commented Jan 20, 2016

I think this means that Markdown isn't being run on the doc string? Do you observe other formatting not being applied?

@mjwillson

This comment has been minimized.

Copy link
Author

commented Jan 20, 2016

Nope other markdown seems to get processed fine.
And it's quite odd that I see bold formatting on the square-brackets in the raw markdown link. (Also the link target text is in monospace font).

Maybe some transformations are happening in the wrong order somewhere?

@BurntSushi

This comment has been minimized.

Copy link
Contributor

commented Jan 20, 2016

I'm not sure what the problem is. The call to markdown is pretty vanilla: https://github.com/BurntSushi/pdoc/blob/master/pdoc/templates/html.mako#L62-L72

@mjwillson

This comment has been minimized.

Copy link
Author

commented Jan 20, 2016

Ah, from looking at linkify, it looks like this was meant to work with single backticks, and my use of double backticks is screwing it up.

I don't get any linkification with single backticks though.

@mjwillson

This comment has been minimized.

Copy link
Author

commented Jan 20, 2016

I think it might be that this line:
ident = matched[1:-1]
https://github.com/BurntSushi/pdoc/blob/master/pdoc/templates/html.mako#L56
isn't needed, which explains why it almost works with an extra level of backticks (they get stripped) but not with single ones as intended (first and last char gets stripped that shouldn't)

@BurntSushi

This comment has been minimized.

Copy link
Contributor

commented Jan 20, 2016

The regex includes the backticks though, so match group 0 includes them as well.

@mjwillson

This comment has been minimized.

Copy link
Author

commented Jan 20, 2016

Maybe this varies by python version or something?

@BurntSushi

This comment has been minimized.

Copy link
Contributor

commented Jan 20, 2016

@mjwillson I don't know. I'm afraid you'll need to either do some debugging or provide enough reproduction details such that I can take a look at it. (I'm not sure when that will happen.)

@mjwillson

This comment has been minimized.

Copy link
Author

commented Jan 21, 2016

After investigating a bit more it seems the issue with double backticks is the regex matches the inner backticks, meaning the outer ones are retained around the replacement. After wiping /tmp/pdoc-3.4 I've managed to get it working with single backticks now though, looks like I was getting the old cached version. Sorry!

@mjwillson mjwillson closed this Jan 21, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.