Skip to content
Permalink
Browse files

Testing slices with 3 elements isn’t always right

h/t @felixfontein

Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information...
Kwpolska committed May 14, 2017
1 parent 79a3914 commit 18c76b13665b0bed359ab940b7861d9172bbdc39
Showing with 1 addition and 1 deletion.
  1. +1 −1 nikola/filters.py
@@ -459,7 +459,7 @@ def deduplicate_ids(data):
# Results are ordered the same way they are ordered in document
offending_elements = doc.xpath('//*[@id="{}"]'.format(i))
counter = 2
for e in offending_elements[1::-1]:
for e in offending_elements[-2::-1]:
new_id = i
while doc.xpath('//*[@id="{}"]'.format(new_id)):
new_id = '{0}-{1}'.format(i, counter)

0 comments on commit 18c76b1

Please sign in to comment.
You can’t perform that action at this time.