Make generated example IDs page specific #210
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #205
Makes the id's generated for examples reset for each page (except where they have another manually assigned id).
ie. the first example on any page is always
id="example-1", the secondid="example-2"and so on (unless they have other id's manually assigned).While hidden, these id's are often used for linking from articles, forums & Q&A sites around the web. Every time they change they break any links to a specific example.
An example of this can be seen on https://phpdelusions.net/pdo/fetch_modes#FETCH_BOUND - the bottom 2 sections of this article have links to specific examples, but these have long since broken due to the way id's are currently generated.
If you think there may be a better way to implement this (specifically where / how to implement the reset counter hook) please let me know.