Tables: use style=text-align for table alignment #357
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Table alignment currently uses
align=left|center|right
which is a deprecated attribute with limited support in modern browsers.At the moment I'm having to post-process the Markdown generated by markdown2.py in order to replace the aligns with text-align as we need good cross-browser support (notably, Firefox completely ignores the
align
attribute).See:
This PR switches instead to the recommended and more widely-supported
style=text-align
: https://caniuse.com/#feat=mdn-css_properties_text-alignAdditionally, in updating the tests I found that they contained a spelling error and that they have their lefts and rights switched (I double-checked the expected output for the syntax on https://help.github.com/en/github/writing-on-github/organizing-information-with-tables ).
I know the
extras
tests are imported from an upstream repo, so I'm not sure how you would prefer to handle this inconsistency, but I thought it was sufficiently confusing to have it read "left" when it expected "right" that it was worth updating.