pykss
pykss copied to clipboard
Reference numbers >= 10 cause abnormal behaviour
Say we have two styleguide sections:
// A square button
//
// Styleguide 2.1
// A round button
//
// Styleguide 2.10
When we add these two sections to a styleguide template, a third section appears that combines the description and markup of the two sections.
This is due to the fact that the templatetag is matching reference numbers using the startswith()
method instead of using an exact match (https://github.com/seanbrant/pykss/blob/master/pykss/contrib/django/templatetags/pykss.py#L54).
I wonder if it's possible to change the line to something like
...
if ref == reference], key=lambda s: s.section)
to fix the issue that arises with a reference number >= 10.