-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Enforce right-alignment for cell in markdown tables #2534
Conversation
I'm wary of adding cc @ellisonbg |
@takluyver I suppose not because in jupyterlab/jupyterlab#2151, @tdaff was actually looking to override the jupyterlab default styles for tables. We do want consistency across notebook and lab though and this would enforce that in notebook. I just don't understand why they're rendering differently given that they're both using marked... I suppose that it could be related to version inconsistency:
|
I've moved this to 'backlog' so we can get on with 5.1, but left it open in case people want to work out where the inconsistency is coming from and what we can do about it. |
Ya, I've explored the marked repo and there haven't been any changes to the markdown table style for 4 years, so the cause must be a discrepancy in the way marked is used in notebook vs. lab. |
Hi gentlemen, Has this issue been resolved? Do we now get the table content as left-aligned or centrally aligned by default, instead of the right alignment? Thanks, |
I have just updated this PR to prevent marked from adding inline style for table cells. As a result, there will be no need for @datasouvik If you prefer the previous styles, then you can add the following to your custom.css (located at .rendered_html tr, .rendered_html th, .rendered_html td {
text-align: center;
}
.rendered_html :first-child {
text-align: left;
}
.rendered_html :last-child {
text-align: right;
} |
@takluyver Care to review/merge? |
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.
One minor point, otherwise it looks good.
return start_tag + content + end_tag; | ||
}; | ||
marked(text, { renderer: renderer }, function (err, html) { | ||
// marked(text, function (err, html) { |
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.
Do you want to clear away these commented out lines now that the new code is working?
@takluyver Thanks, merge away! |
Fixes jupyterlab/jupyterlab#2151