Skip to content
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

Support pandoc headerless table in table formatting #1895

Merged
merged 2 commits into from
Sep 30, 2020

Conversation

cderv
Copy link
Collaborator

@cderv cderv commented Sep 8, 2020

I find this one easy to fix #1893 but I agree that this script exists from some time now (#1893 (comment))

pandoc table can have no header so we could point the selector toward another pandoc table specific class.
See https://github.com/jgm/pandoc/blob/9cad5499c45022b9893156bb5e0468cabefca974/src/Text/Pandoc/Writers/HTML.hs#L954
pandoc adds header class to tr in table header but it also add odd (or even) as class in tr inside tbody. We could use that to target pandoc table. But maybe that is more common class addition than the previous selector.

As you suggested @yihui we could not add support for that and leave the user customise itself using JS (but it must know how...)

If we want to continue with this PR, I'll add some more tests to be sure.

Copy link
Member

@yihui yihui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm okay with this PR. Let's wait and see what @fkohrt feels about the JS solution at #1893 (comment).

Copy link
Member

@yihui yihui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just make this change. I guess it should be safe. If it breaks anything, users will still have the ability to .removeClass() on the tables that shouldn't have been styled, so it won't be the end of the world. Thanks!

@cderv cderv marked this pull request as ready for review September 30, 2020 08:44
@cderv
Copy link
Collaborator Author

cderv commented Sep 30, 2020

Great ! I rebased. We wait for CRAN release before adding a bullet to NEWS and merging

@cderv cderv self-assigned this Sep 30, 2020
@yihui
Copy link
Member

yihui commented Sep 30, 2020

v2.4 is on CRAN now: https://cran.r-project.org/package=rmarkdown

@cderv cderv merged commit e1aebef into rstudio:master Sep 30, 2020
@cderv cderv deleted the headerless-table branch September 30, 2020 20:51
@cderv
Copy link
Collaborator Author

cderv commented Sep 30, 2020

Thanks ! I rebased again and added a NEWS bullet. Feel free to reword in master if necessary.

cderv added a commit that referenced this pull request Nov 24, 2020
cderv added a commit that referenced this pull request Nov 24, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Headerless tables not formatted correctly
2 participants