WP-MarkDown icon indicating copy to clipboard operation
WP-MarkDown copied to clipboard

markdown footnotes taking the user to the top of the page

Open emory opened this issue 12 years ago • 6 comments

I have a problem that I'm noticing on a lot of pages, but this post I wrote today is a good example of it:

You'll notice that the footnotes don't take the user to the footnote itself, but merely bring you to the top of the page. For the life of me I can't figure out why, but I think it's a bug or regression from a previous version of WP-Markdown.

emory avatar Oct 04 '13 17:10 emory

Can't reproduce, can you provide a small bit of MarkDown text that replicates the issue. This works fine for me:

A footnote [^somefootnote]

[^somefootnote]: Footnote message

Your links look a bit malformed though, so maybe its because of the identifier you're using....

stephenharris avatar Oct 12 '13 11:10 stephenharris

Appears to be something in your Javascript, Is there some code that might be capturing the click event and taking you to the top of the document?

When I click directly on the link, I am taken to the top of the page. If I copy the link and paste it into my address bar directly, it takes me to the footer.

You can test this by clicking on your link #fn-107:1 or disabling javascript in your browser.

codemonkee avatar Oct 12 '13 17:10 codemonkee

Well I'll be — found the problematic click event — it's in the Wordpress Sharing module via Jetpack. Thank you for the heads-up, @speroshiropetto!

emory avatar Oct 14 '13 22:10 emory

I have no objections to this issue being closed out, I don't imagine it's a problem with WP-MarkDown (but if you determine it is based on the conflict being with Jetpack, I don't mind if you leave it open for my benefit either.)

emory avatar Oct 14 '13 22:10 emory

Yay, Jetpack does it again :)

I'll leave it open, and will welcome any patch if there is one, but I'm too busy currently to look into this myself (and besides, I'm really not a fan of jetpack ;) )

stephenharris avatar Oct 14 '13 22:10 stephenharris

I may have to revisit this in a bit, it is possible that it's actually Table of Contents Plus that is fudging it, but I have to do more DOM-digging yet be sure. I had disabled both of them and saw OnClick being used by Jetpack — but as I burrowed around I'm seeing some interactions there too.

emory avatar Oct 15 '13 16:10 emory