r"""Tabulate profile output with multi-line support.
(tab, **kwargs)
| 16 | |
| 17 | |
| 18 | def _tabulate_ml(tab, **kwargs): |
| 19 | r"""Tabulate profile output with multi-line support.""" |
| 20 | new_tab = [] |
| 21 | new_tab_is_row = [] |
| 22 | for row in tab: |
| 23 | col_lines = [str(i).split("\n") for i in row] |
| 24 | max_nr_line = max(map(len, col_lines)) |
| 25 | new_tab_is_row.append(True) |
| 26 | if max_nr_line > 1: |
| 27 | new_tab_is_row.extend([False] * (max_nr_line - 1)) |
| 28 | for i in col_lines: |
| 29 | if len(i) < max_nr_line: |
| 30 | i.extend([""] * (max_nr_line - len(i))) |
| 31 | new_tab.extend(zip(*col_lines)) |
| 32 | else: |
| 33 | new_tab.append(row) |
| 34 | |
| 35 | assert len(new_tab_is_row) == len(new_tab) |
| 36 | ret = [i + "\n" for i in tabulate(new_tab, **kwargs).split("\n")] |
| 37 | for idx, val in enumerate(new_tab_is_row): |
| 38 | if not val: |
| 39 | ret[idx * 2 + 2] = "" |
| 40 | return "".join(ret)[:-1] |
| 41 | |
| 42 | |
| 43 | def _tabulate_confluence(tab, **kwargs): |
no test coverage detected