def modifiers(self): from table import row_extract from nijiconf import ROW_BEGIN, ROW_END return [ html.forge, inline.forge, lambda text: ROW_BEGIN + row_extract(text) + ROW_END ]
def modifiers(self): from table import row_extract from nijiconf import ROW_BEGIN, ROW_END return [html.forge, inline.forge, lambda text: ROW_BEGIN + row_extract(text) + ROW_END]
import table from test_common import assert_eq import nijiconf import nijierr text = '||cell1||cell2||cell3||' esc_text = ((nijiconf.CELL_BEGIN % ('', 'cell1')) + nijiconf.CELL_END + (nijiconf.CELL_BEGIN % ('', 'cell2')) + nijiconf.CELL_END + (nijiconf.CELL_BEGIN % ('', 'cell3')) + nijiconf.CELL_END + (nijiconf.CELL_BEGIN % ('', '')) + nijiconf.CELL_END) assert_eq(esc_text, table.row_extract(text)) text = '||cell||;hc;attr-cell' esc_text = ((nijiconf.CELL_BEGIN % ('', 'cell')) + nijiconf.CELL_END + (nijiconf.CELL_BEGIN % (nijiconf.CELL_HORI_ALGN % nijiconf.CELL_HORI_ALIGNMENT_MAP['c'] , 'attr-cell')) + nijiconf.CELL_END) assert_eq(esc_text, table.row_extract(text)) text = '||n;htr2||no attr cell' esc_text = ((nijiconf.CELL_BEGIN % ('', 'n;htr2')) + nijiconf.CELL_END + (nijiconf.CELL_BEGIN % ('', 'no attr cell')) + nijiconf.CELL_END) assert_eq(esc_text, table.row_extract(text)) text = '|only one||| three lines||;another cell' esc_text = ('|only one' + (nijiconf.CELL_BEGIN % ('', '| three lines')) + nijiconf.CELL_END + (nijiconf.CELL_BEGIN % ('', ';another cell')) + nijiconf.CELL_END) assert_eq(esc_text, table.row_extract(text))