-
-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: fixTableCellAlign
option
#48
Conversation
This comment has been minimized.
This comment has been minimized.
Looks like a ts-ignore which I removed was necessary after all. I'll fix and add some tests... |
f19c25d
to
8e32806
Compare
Codecov ReportPatch coverage:
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more Additional details and impacted files@@ Coverage Diff @@
## main #48 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 2 2
Lines 117 129 +12
=========================================
+ Hits 117 129 +12
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
Ready for review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Mostly some stylistic suggestion, otherwise looks good!
lib/index.js
Outdated
* Default: true. Map deprecated table-related attributes to css styles as | ||
* recommended by Mozilla Developer Network docs. E.g. | ||
* `align="center"` to `style="text-align: center;"`. May result | ||
* in rendering differences. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some recommendations:
* Default: true. Map deprecated table-related attributes to css styles as | |
* recommended by Mozilla Developer Network docs. E.g. | |
* `align="center"` to `style="text-align: center;"`. May result | |
* in rendering differences. | |
* Fix obsolete align attributes on table cells by turning them into inline | |
* styles. | |
* Keep it on when working with markdown, turn it off when working with | |
* markup for emails. |
Feel free to iterate on this.
- Uses semantic line breaks
default: true
is already added with the[xxx=true]
notation- the goal of this feature is to solve obsolete attributes, not just because MDN says it too
- adds a recommendation on when to have it on/off
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I accepted this change with the exception that I kept the Default: true
comment at the end. When typescript processes this comment and creates the SharedOptions
interface, it keeps the JSDoc comments but doesn't keep any reference to [fixTableCellAlign=true]
(so, when inspecting the type in the editor, you don't know that it has a default value). By also referencing the default value in the comment, we ensure that the generated type retains this information.
For example, here's what I see when I inspect the prefix
option in VS Code. There is no reference to a default value in the editor tooltip and there also isn't a reference to it in the generated typescript type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like this is a TypeScript bug.
As you show, it’s also in all the other options here.
And in all the other projects.
It doesn’t hurt too much to include this information if TypeScript doesn’t but then it should be a sentence, and also use `code`
.
1033e03
to
16122fc
Compare
mapDepricatedTableCellAttrsToInlineCss
optionfixTableCellAlign
option
Adds a new plugin option, `mapDepricatedTableCellAttrsToInlineCss`, which controls whether table-related attributes are mapped to inline CSS styles. Defaults to `true`.
lib/index.js
Outdated
* Default: true. Map deprecated table-related attributes to css styles as | ||
* recommended by Mozilla Developer Network docs. E.g. | ||
* `align="center"` to `style="text-align: center;"`. May result | ||
* in rendering differences. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like this is a TypeScript bug.
As you show, it’s also in all the other options here.
And in all the other projects.
It doesn’t hurt too much to include this information if TypeScript doesn’t but then it should be a sentence, and also use `code`
.
Signed-off-by: Titus <tituswormer@gmail.com>
Signed-off-by: Titus <tituswormer@gmail.com>
This comment has been minimized.
This comment has been minimized.
Thanks, released in 7.2.0! |
Initial checklist
Description of changes
Adds a new plugin option,
mapDepricatedTableCellAttrsToInlineCss
fixTableCellAlign
, which controls whether table-related attributes are mapped to inline CSS styles. Defaults totrue
.Closes #47
Notes:
.
when viewing a repo) so I'm not sure if this conforms to any required lint/formatting rules.