Fix the error of token_list formatting only taking the first digit when the number of cells across rows or columns is greater than 10 (#11839)

pull/11871/head
WangZ 2024-04-01 15:22:11 +08:00 committed by GitHub
parent bc06f6f259
commit 6ed5562ced
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -209,10 +209,10 @@ def convert_token(html_list):
token_list.append("<td")
if 'colspan' in col:
_, n = col.split('colspan=')
token_list.append(" colspan=\"{}\"".format(n[0]))
token_list.append(" colspan=\"{}\"".format(str(int(n))))
if 'rowspan' in col:
_, n = col.split('rowspan=')
token_list.append(" rowspan=\"{}\"".format(n[0]))
token_list.append(" rowspan=\"{}\"".format(str(int(n))))
token_list.extend([">", "</td>"])
token_list.append("</tr>")
token_list.append("</tbody>")