if end_index < len(template):
                    end_index += template[end_index] == '\n' and 1 or 0