Skip to content
Snippets Groups Projects
Commit 4bfce4d0 authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega
Browse files

Fixes for merged rows

parent dffceed3
No related branches found
No related tags found
1 merge request!1Restructuring and cleaning scripts for Mkdocs
...@@ -398,6 +398,7 @@ def parseGridTableWithSpans(gridTable:str) -> tuple[GridTableRowList, GridTableR ...@@ -398,6 +398,7 @@ def parseGridTableWithSpans(gridTable:str) -> tuple[GridTableRowList, GridTableR
if len(cellsContent) <= numberOfColumns: # Colspan: Positions of | with respect to + need to be determined if len(cellsContent) <= numberOfColumns: # Colspan: Positions of | with respect to + need to be determined
columnCellIndex = 0 columnCellIndex = 0
maxRowsTracker = max(rowsTracker)
# Go through all cells in a columnt # Go through all cells in a columnt
for columnIndex, content in enumerate(cellsContent): for columnIndex, content in enumerate(cellsContent):
rowIndex = rowsTracker[columnCellIndex] rowIndex = rowsTracker[columnCellIndex]
...@@ -405,7 +406,7 @@ def parseGridTableWithSpans(gridTable:str) -> tuple[GridTableRowList, GridTableR ...@@ -405,7 +406,7 @@ def parseGridTableWithSpans(gridTable:str) -> tuple[GridTableRowList, GridTableR
# Check whether a cell contains a header separator # Check whether a cell contains a header separator
if matchGridTableBodySeparatorLine.match(content): # A new row is to be added if matchGridTableBodySeparatorLine.match(content): # A new row is to be added
rowsTracker[columnCellIndex] = max(rowsTracker) + 1 # That actual row will have more than one row rowsTracker[columnCellIndex] = maxRowsTracker + 1 # That actual row will have more than one row
cell.listFlag = False cell.listFlag = False
columnForward = 0 columnForward = 0
...@@ -413,7 +414,7 @@ def parseGridTableWithSpans(gridTable:str) -> tuple[GridTableRowList, GridTableR ...@@ -413,7 +414,7 @@ def parseGridTableWithSpans(gridTable:str) -> tuple[GridTableRowList, GridTableR
rowIndex = rowsTracker[columnCellIndex] # Correcting the rowIndex. Might have been changed by a previous iteration rowIndex = rowsTracker[columnCellIndex] # Correcting the rowIndex. Might have been changed by a previous iteration
if rows[rowIndex][columnCellIndex].position >= delimiterPositions[delIndex]: if rows[rowIndex][columnCellIndex].position >= delimiterPositions[delIndex]:
columnForward += 1 columnForward += 1
rowsTracker[columnCellIndex + columnForward - 1] = max(rowsTracker) + 1 if columnForward > 1 else 0 rowsTracker[columnCellIndex + columnForward - 1] = maxRowsTracker + 1 if columnForward > 1 else 0
columnCellIndex += columnForward columnCellIndex += columnForward
continue continue
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment