def split_stacks(self, stacks: List[List[BaseLayer]])-> List[List[BaseLayer]]:
ns: List[List[BaseLayer]] = []<EOL>for stack in stacks:<EOL><INDENT>cur: List[BaseLayer] = []<EOL>for layer in stack:<EOL><INDENT>if cur and isinstance(layer, lyr.RawText):<EOL><INDENT>ns.append(cur)<EOL>cur = []<EOL><DEDENT>cur.append(layer)<EOL><DEDENT>if cur:<EOL><INDENT>ns.append(cur)<EOL><DEDENT><DEDENT>return ns<EOL>
First step of the stacks cleanup process. We consider that if inside
a stack there's a text layer showing up then it's the beginning of a
new stack and split upon that.