If the last table of a cell is blank then it is missing in the rendered HTML.
This appears to be because the last pipe is removed to avoid an extra row being created if by the split function.
A crude fix to this would look something like
def parse_table(self, m):
item = self._process_table(m)
#JP fix for blank last cell in table
rmat = re.match(r'^(.*)(?<=\|)(.*)\|\s*\n$',m.group(3),re.S)
if rmat:
if rmat.group(2).strip() == '':
cells = rmat.group(1) +'|'
else:
cells = rmat.group(1) + rmat.group(2)
# original
#cells = re.sub(r'(?: *\| *)?\n$', '', m.group(3))
logger_m.debug(cells)
cells = cells.split('\n')
for i, v in enumerate(cells):
v = re.sub(r'^ *\| *| *\| *$', '', v)
cells[i] = re.split(r' *\| *', v)
item['cells'] = cells
self.tokens.append(item)
If the last table of a cell is blank then it is missing in the rendered HTML.
This appears to be because the last pipe is removed to avoid an extra row being created if by the split function.
A crude fix to this would look something like