File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -473,8 +473,19 @@ def _(
473473 table_structure = _extract_table_structure (node = node )
474474
475475 if len (table_structure .header_rows ) > 1 :
476+ first_header_row = table_structure .header_rows [0 ]
477+ first_header_row_entry = first_header_row .children [0 ]
478+ first_header_row_paragraph = first_header_row_entry .children [0 ]
479+ first_header_row_line = first_header_row_paragraph .line
480+ last_header_row = table_structure .header_rows [- 1 ]
481+ last_header_row_entry = last_header_row .children [0 ]
482+ last_header_row_paragraph = last_header_row_entry .children [0 ]
483+ last_header_row_line = last_header_row_paragraph .line
476484 table_multiple_header_rows_msg = (
477- "Tables with multiple header rows are not supported."
485+ "Tables with multiple header rows are not supported. "
486+ f"First header row is on line { first_header_row_line } in "
487+ f"{ first_header_row_paragraph .source } , last header row is on "
488+ f"line { last_header_row_line } "
478489 )
479490 raise ValueError (table_multiple_header_rows_msg )
480491
Original file line number Diff line number Diff line change @@ -1826,7 +1826,12 @@ def test_list_table_header_maximum_one_allowed(
18261826 - Cell a 2
18271827 """
18281828
1829- expected_message = r"^Tables with multiple header rows are not supported.$"
1829+ expected_message = (
1830+ r"^Tables with multiple header rows are not supported. "
1831+ r"First header row is on line 4 in "
1832+ rf"{ re .escape (pattern = str (object = tmp_path / 'src' / 'index.rst' ))} , "
1833+ r"last header row is on line 6"
1834+ )
18301835 with pytest .raises (expected_exception = ValueError , match = expected_message ):
18311836 _assert_rst_converts_to_notion_objects (
18321837 rst_content = rst_content ,
You can’t perform that action at this time.
0 commit comments