INNER CODE UNIT · Python
extract_tab_group
CodeSmile-0000011110110111/LunyScript-RFC · scripts/fix-tabs-final.py:33
def extract_tab_group(lines, start):
"""Extract entire tab group from lines"""
end = start
depth = 0
group_lines = []
for j in range(start, len(lines)):
line = lines[j]
group_lines.append(line)
if '<div' in line:
depth += 1
if '</div>' in line:
depth -= 1
if depth == 0 and j > start:
end = j
break