gistpress icon indicating copy to clipboard operation
gistpress copied to clipboard

Duplicate IDs

Open GaryJones opened this issue 9 years ago • 3 comments

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.

GaryJones avatar Sep 18 '14 10:09 GaryJones

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.

bradyvercher avatar Sep 19 '14 19:09 bradyvercher

I guess removing it would be sufficient.

GaryJones avatar Sep 20 '14 11:09 GaryJones

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

jdelia avatar Mar 20 '16 16:03 jdelia