bradyvercher / gistpress

WordPress plugin to add Gist oEmbed and shortcode support with caching.
GNU General Public License v2.0
143 stars 28 forks source link

Duplicate IDs #51

Closed GaryJones closed 1 year ago

GaryJones commented 10 years ago

If you look at the source for http://www.poststat.us/automating-i18n-wordpress-themes/ you'll see that the gists produce duplicate IDs, where the same gist has been used (but showing different lines).

This <div id="gist..."> comes from the GitHub JSON, but we should find a way to fix it, since we're the ones allowing multiple uses of it. We can't use line-numbers as a suffix, since that wouldn't cover when the whole of a gist is shown twice (i.e. start and end of a tutorial).

We might need to count the gist references (whether by shortcode or oembed) during the request (request, not post, so it can cover the same gist being shown multiple times in full-content post archive) and add an index accordingly.

bradyvercher commented 10 years ago

Is the ID useful? What if we were to remove it altogether? Otherwise, a counter sounds like the best bet and is how WordPress handles things like galleries.

Aside from that main ID, there are other instances of duplicate IDs further down in the Gist, but that's more an issue with GitHub not accounting for scenarios where similar Gists appear on the same page.

GaryJones commented 10 years ago

I guess removing it would be sufficient.

jdelia commented 8 years ago

Any updates on this? The duplicate ID is still an issue.