stephenharris / WP-MarkDown

WP-MarkDown plug-in. Allows Markdown to be enabled in posts, comments and bbPress forums.
http://wordpress.org/extend/plugins/wp-markdown/
112 stars 19 forks source link

markdown footnotes taking the user to the top of the page #32

Open emory opened 10 years ago

emory commented 10 years ago

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.

stephenharris commented 10 years ago

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....

codemonkee commented 10 years ago

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.

emory commented 10 years ago

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 commented 10 years ago

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.)

stephenharris commented 10 years ago

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 ;) )

emory commented 10 years ago

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.