Module:Sidebar: Difference between revisions
Appearance
←Created page with '-- -- This module implements {{Sidebar}} -- local p = {} local HtmlBuilder = require('Module:HtmlBuilder') local Navbar = require('Module:Navbar') local fu...' |
fix duplicated rows |
||
Line 125: | Line 125: | ||
end | end | ||
table.sort(rowNums) | table.sort(rowNums) | ||
-- remove duplicates from the list (e.g. 3 will be duplicated if both heading3 and content3 are specified) | |||
for i = #rowNums, 1, -1 do | |||
if rowNums[i] == rowNums[i - 1] then | |||
table.remove(rowNums, i) | |||
end | |||
end | |||
for i, num in ipairs(rowNums) do | for i, num in ipairs(rowNums) do |