1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-08-29 02:00:12 +02:00

Fixed bom.py, views.py and tests.py so that vitamin descriptions can contain more than one colon.

This commit is contained in:
Chris Palmer
2023-04-29 09:22:35 +01:00
parent deb0c14aa2
commit b1592f51d4
3 changed files with 8 additions and 8 deletions

View File

@@ -259,11 +259,11 @@ def tests(tests):
things = BOM[thing]
if things:
body += ['### %s\n| Qty | %s |\n| ---:|:--- |%s' % (thing.title(), heading, ':---|' if '|' in heading else '')]
for item in sorted(things, key = lambda s: s.split(":")[-1]):
for item in sorted(things, key = lambda s: s.split(":",1)[-1]):
name = item
desc = ''
if thing == "vitamins":
vit = item.split(':')
vit = item.split(':', 1)
name = '`' + vit[0] + '`' if vit[0] else ''
while '[[' in name and ']]' in name:
i = name.find('[[')