Skip to content

change: unique source code span and codeline IDs #200

@brynpickering

Description

@brynpickering

Is your change request related to a problem? Please describe.

When using show_source the code snippet has a span and codelineno ID per line, e.g. </span><span id="__span-0-35"><a id="__codelineno-0-35" name="__codelineno-0-35"></a>.

If referencing the same line in two different code snippets (e.g. the same line from two different modules given on the same page or the same method being referenced as it is inherited from the parent abstract base class in a module), there are duplicate instances of the same spand and codeline ID. Accessibility checkers complain about this, and with good reason!

Describe the solution you'd like

Ideally, each source code snippet would have some kind of unique code (maybe a random hash?) that is added to the IDs.

Describe alternatives you've considered

For now, I've simply ignored these types of IDs in my Accessibility checker, but it is non-ideal...

Additional context

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions