From e440084f092f0a689642f558c42ad2a75047236d Mon Sep 17 00:00:00 2001 From: Kat Hagan Date: Sat, 13 Jun 2020 17:18:30 -0700 Subject: [PATCH] change to text-align for table alignment and update tests --- lib/markdown2.py | 6 ++-- test/php-markdown-extra-cases/Tables.html | 40 +++++++++++------------ test/php-markdown-extra-cases/Tables.text | 12 +++---- 3 files changed, 29 insertions(+), 29 deletions(-) diff --git a/lib/markdown2.py b/lib/markdown2.py index 4b55d11b..eb066151 100755 --- a/lib/markdown2.py +++ b/lib/markdown2.py @@ -1013,11 +1013,11 @@ def _table_sub(self, match): align_from_col_idx = {} for col_idx, col in enumerate(cols): if col[0] == ':' and col[-1] == ':': - align_from_col_idx[col_idx] = ' align="center"' + align_from_col_idx[col_idx] = ' style="text-align:center;"' elif col[0] == ':': - align_from_col_idx[col_idx] = ' align="left"' + align_from_col_idx[col_idx] = ' style="text-align:left;"' elif col[-1] == ':': - align_from_col_idx[col_idx] = ' align="right"' + align_from_col_idx[col_idx] = ' style="text-align:right;"' # thead hlines = ['' % self._html_class_str_from_tag('table'), '', ''] diff --git a/test/php-markdown-extra-cases/Tables.html b/test/php-markdown-extra-cases/Tables.html index 408693ec..95b9c2a9 100644 --- a/test/php-markdown-extra-cases/Tables.html +++ b/test/php-markdown-extra-cases/Tables.html @@ -133,56 +133,56 @@

One-column one-row table


-

Table alignement:

+

Table alignment:

- - - + + + - - - + + + - - - + + +
DefaultRightCenterLeftLeftCenterRight
Long CellLong CellLong CellLong CellLong CellLong CellLong Cell
CellCellCellCellCellCellCell
-

Table alignement (alternate spacing):

+

Table alignment (alternate spacing):

- - - + + + - - - + + + - - - + + +
DefaultRightCenterLeftLeftCenterRight
Long CellLong CellLong CellLong CellLong CellLong CellLong Cell
CellCellCellCellCellCellCell
diff --git a/test/php-markdown-extra-cases/Tables.text b/test/php-markdown-extra-cases/Tables.text index 3deb3a69..b761ad91 100644 --- a/test/php-markdown-extra-cases/Tables.text +++ b/test/php-markdown-extra-cases/Tables.text @@ -50,19 +50,19 @@ With leading and tailing pipes: * * * -Table alignement: +Table alignment: -| Default | Right | Center | Left | +| Default | Left | Center | Right | | --------- |:--------- |:---------:| ---------:| | Long Cell | Long Cell | Long Cell | Long Cell | -| Cell | Cell | Cell | Cell | +| Cell | Cell | Cell | Cell | -Table alignement (alternate spacing): +Table alignment (alternate spacing): -| Default | Right | Center | Left | +| Default | Left | Center | Right | | --------- | :-------- | :-------: | --------: | | Long Cell | Long Cell | Long Cell | Long Cell | -| Cell | Cell | Cell | Cell | +| Cell | Cell | Cell | Cell | * * *